main.c 621 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2006-2018, Synwit Technology Co.,Ltd.
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018-12-10 Zohar_Lee first version
  9. */
  10. #include <rtthread.h>
  11. #include <rtdevice.h>
  12. /* defined the LED pin: PA12 */
  13. #define LED_PIN 100
  14. int main(void)
  15. {
  16. int count = 1;
  17. /* set LED4 pin mode to output */
  18. rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT);
  19. while (count++)
  20. {
  21. rt_pin_write(LED_PIN, PIN_HIGH);
  22. rt_thread_mdelay(500);
  23. rt_pin_write(LED_PIN, PIN_LOW);
  24. rt_thread_mdelay(500);
  25. }
  26. return RT_EOK;
  27. }