main.c 552 B

1234567891011121314151617181920212223242526272829
  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. * 2020-06-27 AHTYDHD the first version
  9. */
  10. #include <rtthread.h>
  11. #include <rtdevice.h>
  12. int main(void)
  13. {
  14. int count = 1;
  15. /* set LED0 pin mode to output */
  16. rt_pin_mode(2, PIN_MODE_OUTPUT);
  17. while (count++)
  18. {
  19. rt_pin_write(2, PIN_HIGH);
  20. rt_thread_mdelay(500);
  21. rt_pin_write(2, PIN_LOW);
  22. rt_thread_mdelay(500);
  23. }
  24. return RT_EOK;
  25. }