1 /*
2  * Copyright (c) 2006-2022, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2022-09-01     liYony       first version
9  * 2023-12-03     Meco Man     support nano version
10  */
11 
12 #include <board.h>
13 #include <rtthread.h>
14 #include <drv_gpio.h>
15 #ifndef RT_USING_NANO
16 #include <rtdevice.h>
17 #endif /* RT_USING_NANO */
18 
19 /* defined the LED1 pin: PB0 */
20 #define LED1_PIN    GET_PIN(B, 0)
21 
main(void)22 int main(void)
23 {
24     /* set LED0 pin mode to output */
25     rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
26 
27     while (1)
28     {
29         rt_pin_write(LED1_PIN, PIN_HIGH);
30         rt_thread_mdelay(500);
31         rt_pin_write(LED1_PIN, PIN_LOW);
32         rt_thread_mdelay(500);
33     }
34 }
35