main.c 778 B

1234567891011121314151617181920212223242526272829303132333435
  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. * 2019-01-11 RiceChen first edition
  9. * 2023-12-03 Meco Man support nano version
  10. */
  11. #include <board.h>
  12. #include <rtthread.h>
  13. #include <drv_gpio.h>
  14. #ifndef RT_USING_NANO
  15. #include <rtdevice.h>
  16. #endif /* RT_USING_NANO */
  17. /* defined the LED pin: PC13 */
  18. #define LED0_PIN GET_PIN(C, 13)
  19. int main(void)
  20. {
  21. rt_kprintf("---Welcome use BearPi---\n");
  22. /* set LED pin mode to output */
  23. rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
  24. while (1)
  25. {
  26. rt_pin_write(LED0_PIN, PIN_HIGH);
  27. rt_thread_mdelay(500);
  28. rt_pin_write(LED0_PIN, PIN_LOW);
  29. rt_thread_mdelay(500);
  30. }
  31. }