Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-------------------------------------------------- Zephyr Defintions ------------------------------------------
- # include <zephyr.h>
- # include <device.h>
- # include <devicetree.h>
- # include <drivers/pwm.h> // Include the PWM Driver
- # include <drivers/gpio.h> // Incldue the GPIO Driver
- # include <inttypes.h>
- // -----------------------------------------------------------------------------------------------------------
- const struct gpio_dt_spec signal = GPIO_DT_SPEC_GET(ZEPHYR_USER_NODE, signal_gpios);
- // /* Configure the pin */
- gpio_pin_configure_dt(&signal, GPIO_OUTPUT_ACTIVE);
- bool is_led_on = false;
- void main(void)
- {
- while(1)
- {
- gpio_pin_set(signal.port, signal.pin, (int)is_led_on);
- is_led_on = !is_led_on;
- k_sleep(K_SECONDS(SLEEP_TIME_S));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement