main.c 596 B

12345678910111213141516171819202122232425262728293031
  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-27 Jiao first version
  9. * 2022-07-20 wudiyidashi support gpio
  10. */
  11. #include <rtthread.h>
  12. #include "board.h"
  13. #define LED1 GET_PIN(D, 4)
  14. int main(void)
  15. {
  16. rt_pin_mode(LED1, PIN_MODE_OUTPUT);
  17. rt_pin_write(LED1, PIN_HIGH);
  18. while (1)
  19. {
  20. rt_pin_write(LED1, PIN_HIGH);
  21. rt_thread_mdelay(500);
  22. rt_pin_write(LED1, PIN_LOW);
  23. rt_thread_mdelay(500);
  24. }
  25. }