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 * 2021-08-20 BruceOu first implementation 9 */ 10 11 #include <stdio.h> 12 #include <rtthread.h> 13 #include <rtdevice.h> 14 #include <board.h> 15 16 /* defined the LED2 pin: PC0 */ 17 #define LED2_PIN GET_PIN(C, 0) 18 main(void)19int main(void) 20 { 21 int count = 1; 22 23 /* set LED2 pin mode to output */ 24 rt_pin_mode(LED2_PIN, PIN_MODE_OUTPUT); 25 26 while (count++) 27 { 28 rt_pin_write(LED2_PIN, PIN_HIGH); 29 rt_thread_mdelay(500); 30 rt_pin_write(LED2_PIN, PIN_LOW); 31 rt_thread_mdelay(500); 32 } 33 34 return RT_EOK; 35 } 36