Guest User

Untitled

a guest
Dec 15th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <zephyr.h>
  2. #include <misc/printk.h>
  3. #include <gpio.h>
  4.  
  5. #define LED_PORT DT_GPIO_STM32_GPIOC_LABEL
  6. #define LED_PIN 9
  7.  
  8. void main(void)
  9. {
  10. int cnt = 0;
  11. struct device *dev;
  12.  
  13. dev = device_get_binding(LED_PORT);
  14. gpio_pin_configure(dev, LED_PIN, GPIO_DIR_OUT);
  15.  
  16. while (1)
  17. {
  18. gpio_pin_write(dev, LED_PIN, cnt % 2);
  19. cnt++;
  20. k_sleep(500);
  21. }
  22. }
Add Comment
Please, Sign In to add comment