main.c 802 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-09-09 forest-rain first version
  9. */
  10. #include <rtthread.h>
  11. #include <rtdevice.h>
  12. #include <board.h>
  13. /* STM32WL55JC_NUCLEO Color led */
  14. #define LED_BLUE_PIN GET_PIN(B,15) /* defined the LED_BLUE pin: PB15 */
  15. #define LED_GREEN_PIN GET_PIN(B,9)
  16. #define LED_RED_PIN GET_PIN(B,11)
  17. int main(void)
  18. {
  19. int count = 1;
  20. /* set LED_BLUE pin mode to output */
  21. rt_pin_mode(LED_BLUE_PIN, PIN_MODE_OUTPUT);
  22. while (count++)
  23. {
  24. rt_pin_write(LED_BLUE_PIN, PIN_HIGH);
  25. rt_thread_mdelay(500);
  26. rt_pin_write(LED_BLUE_PIN, PIN_LOW);
  27. rt_thread_mdelay(500);
  28. }
  29. return RT_EOK;
  30. }