1
0

main.c 837 B

123456789101112131415161718192021222324252627282930313233343536
  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. * 2019-03-08 obito0 first version
  9. */
  10. #include <rtthread.h>
  11. #include <rtdevice.h>
  12. #include <board.h>
  13. /* defined the LED0 pin: PB5 */
  14. #define LED0_PIN GET_PIN(B, 5)
  15. /* defined the LED1 pin: PE5 */
  16. #define LED1_PIN GET_PIN(E, 5)
  17. int main(void)
  18. {
  19. /* set LED0 pin mode to output */
  20. rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
  21. /* set LED1 pin mode to output */
  22. rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
  23. while (1)
  24. {
  25. rt_pin_write(LED0_PIN, PIN_HIGH);
  26. rt_pin_write(LED1_PIN, PIN_HIGH);
  27. rt_thread_mdelay(500);
  28. rt_pin_write(LED0_PIN, PIN_LOW);
  29. rt_pin_write(LED1_PIN, PIN_LOW);
  30. rt_thread_mdelay(500);
  31. }
  32. }