main.c 670 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2006-2021, 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. * 2019-10-19 xuzhuoyi add stm32f429-st-disco bsp
  10. */
  11. #include <rtthread.h>
  12. #include <rtdevice.h>
  13. #include <board.h>
  14. /* defined the LED1 pin: PG13 */
  15. #define LED1_PIN GET_PIN(G, 13)
  16. int main(void)
  17. {
  18. /* set LED1 pin mode to output */
  19. rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
  20. while (1)
  21. {
  22. rt_pin_write(LED1_PIN, PIN_HIGH);
  23. rt_thread_mdelay(500);
  24. rt_pin_write(LED1_PIN, PIN_LOW);
  25. rt_thread_mdelay(500);
  26. }
  27. }