Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <zephyr.h>
- #include <misc/printk.h>
- #include <gpio.h>
- #define LED_PORT DT_GPIO_STM32_GPIOC_LABEL
- #define LED_PIN 9
- void main(void)
- {
- int cnt = 0;
- struct device *dev;
- dev = device_get_binding(LED_PORT);
- gpio_pin_configure(dev, LED_PIN, GPIO_DIR_OUT);
- while (1)
- {
- gpio_pin_write(dev, LED_PIN, cnt % 2);
- cnt++;
- k_sleep(500);
- }
- }
Add Comment
Please, Sign In to add comment