Hi,
I'm using GPIO pin as input button with nrf9160 using Zephyr RTOS, but when I was press the button I didn't get any response from button state.
hear is my code
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <zephyr/zephyr.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/printk.h>
#include <inttypes.h>
#define SLEEP_TIME_MS 1000
#define button 6
void main(void)
{
int ret;
int count=0;
int gpio_dev =device_get_binding("GPIO_0");
if(!gpio_dev)
{
printk("Cannot bind gpio device\n");
return 0;
when I press button count value not changing, if anyone know where I did wrong please help me to solve this.
thank you