[stm32f401 nucleo] update main.c revert blinking LED

This commit is contained in:
Meco Man 2022-09-19 23:43:20 -04:00 committed by Man, Jianting (Meco)
parent f71a287a68
commit 560166477e
1 changed files with 12 additions and 3 deletions

View File

@ -6,16 +6,25 @@
* Change Logs:
* Date Author Notes
* 2018-11-06 SummerGift first version
* 2022-04-19 Meco Man solve LED interferes with SPI
*/
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
/* defined the LD2 (user LED) pin: PB1 */
#define LED2_PIN GET_PIN(A, 5)
int main(void)
{
/* set LED0 pin mode to output */
rt_pin_mode(LED2_PIN, PIN_MODE_OUTPUT);
while (1)
{
rt_kprintf("Hello RT-Thread!\n");
rt_thread_mdelay(1000);
rt_pin_write(LED2_PIN, PIN_HIGH);
rt_thread_mdelay(500);
rt_pin_write(LED2_PIN, PIN_LOW);
rt_thread_mdelay(500);
}
}