main.c 637 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2019-10-25 zylx first version
  9. */
  10. #include <rtdevice.h>
  11. #include <drv_gpio.h>
  12. /* defined the LED1 pin: PC13 */
  13. #define LED1_PIN GET_PIN(C, 13)
  14. int main(void)
  15. {
  16. int count = 1;
  17. /* set LED0 pin mode to output */
  18. rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
  19. while (count++)
  20. {
  21. rt_pin_write(LED1_PIN, PIN_HIGH);
  22. rt_thread_mdelay(500);
  23. rt_pin_write(LED1_PIN, PIN_LOW);
  24. rt_thread_mdelay(500);
  25. }
  26. return RT_EOK;
  27. }