This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF9160 DK & Seeed Relay Shield v3.0

Please provide sample code on how to configure pins to control Relay Shield from Seeed on nRF9160 DK

https://wiki.seeedstudio.com/Relay_Shield_v3/

I have used the following code but it is not working:

struct device * relay_device = device_get_binding(DT_LABEL(DT_NODELABEL(gpio0)));
gpio_pin_configure(relay_device, 4, GPIO_OUTPUT);
gpio_pin_configure(relay_device, 5, GPIO_OUTPUT);
gpio_pin_configure(relay_device, 6, GPIO_OUTPUT);
gpio_pin_configure(relay_device, 7, GPIO_OUTPUT);

gpio_pin_set(relay_device, 4, true);
gpio_pin_set(relay_device, 5, true);
gpio_pin_set(relay_device, 6, true);
gpio_pin_set(relay_device, 7, true);
Parents Reply Children
No Data
Related