1
0

main.c 679 B

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