1
0

main.c 757 B

1234567891011121314151617181920212223242526272829303132
  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-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. /* set LED_BLUE pin mode to output */
  20. rt_pin_mode(LED_BLUE_PIN, PIN_MODE_OUTPUT);
  21. while (1)
  22. {
  23. rt_pin_write(LED_BLUE_PIN, PIN_HIGH);
  24. rt_thread_mdelay(500);
  25. rt_pin_write(LED_BLUE_PIN, PIN_LOW);
  26. rt_thread_mdelay(500);
  27. }
  28. }