1 /* 2 * Copyright (c) 2006-2018, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2018-11-06 SummerGift 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 LED0 pin: PC13 */ 20 #define LED0_PIN GET_PIN(C, 13) 21 main(void)22int main(void) 23 { 24 int count = 1; 25 /* set LED0 pin mode to output */ 26 rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT); 27 28 while (count++) 29 { 30 rt_pin_write(LED0_PIN, PIN_HIGH); 31 rt_thread_mdelay(500); 32 rt_pin_write(LED0_PIN, PIN_LOW); 33 rt_thread_mdelay(500); 34 } 35 36 return RT_EOK; 37 } 38