Close

LED test

A project log for Open Source Transparent Watch - T1

A open source transparent watch, ultra-thin, BLE, 20mm strap

modularModular 07/27/2021 at 13:100 Comments
#include "hal_gpio.h"

uint32_t count = 0;

void gpio_blink_init(void)
{
    gpio_set_mode(GPIO_PIN_17, GPIO_OUTPUT_PP_MODE);
    gpio_write(GPIO_PIN_17, 0);
}

void led_blink_all(void)
{
    gpio_write(GPIO_PIN_17, 0);
    bflb_platform_delay_ms(100);

    gpio_write(GPIO_PIN_17, 1);
    bflb_platform_delay_ms(100);
}

void led_running(void)
{
    gpio_write(GPIO_PIN_17, 1);
    bflb_platform_delay_ms(500);
    gpio_write(GPIO_PIN_17, 0);
    bflb_platform_delay_ms(500);

    count++;
}

int main(void)
{
    bflb_platform_init(0);

    gpio_blink_init();

    MSG("gpio test !\r\n");

    while (1) {
        led_running();
    }
}

Discussions