main.c 629 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2020-2021, Bluetrum Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020/12/10 greedyhao The first version
  9. */
  10. #include <rtthread.h>
  11. #include "board.h"
  12. int main(void)
  13. {
  14. uint32_t cnt = 0;
  15. uint8_t pin = rt_pin_get("PE.1");
  16. rt_pin_mode(pin, PIN_MODE_OUTPUT);
  17. rt_kprintf("Hello, world\n");
  18. while (1)
  19. {
  20. if (cnt % 2 == 0) {
  21. rt_pin_write(pin, PIN_LOW);
  22. } else {
  23. rt_pin_write(pin, PIN_HIGH);
  24. }
  25. cnt++;
  26. rt_thread_mdelay(1000);
  27. }
  28. return 0;
  29. }