How can I read the GPIO pins

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello

I have a developer board with a dht11 (umidity & temperature sensor)

How can I get the information ,maybe samplee code

like this one ?

wiced_gpio_input_get( WICED_GPIO_XX)

0 Likes
1 Solution
Anonymous
Not applicable

Or you can use the higher-level APIs like wiced_gpio_init and wiced_gpio_deinit to switch back and forth between output and input

View solution in original post

0 Likes
5 Replies
JaeyoungY_71
Employee
Employee
First comment on KBA 25 solutions authored 10 solutions authored

Which board are you using? Please take a look at our sample GPIO app in <SDK>/snip/gpio/gpio.c which toggles the GPIO out and read GPIO in.

Thanks,

Jaeyoung

0 Likes
Anonymous
Not applicable

I use the Board BCM94343W_AVN and i have a DHT11

0 Likes

You should check the DHT11 datasheet how to read the temp/humility from DHT 11!

0 Likes
Anonymous
Not applicable

Currently this is not a straightforward task since the DHT11 is a single wire serial sensor and requires switching between output and input for control and read.

So in your case in the platform.c for the BCM94343W_AVN platform, you will have to write support for switching the GPIO for the IO you are using.

platform_gpio_init can be used to switch between output and input modes

and then platform_gpio_input_high, platfom_gpio_input_low and platform_gpio_input_get will have to be used to implement the DHT11 driver library


Currently we don't have sample code for this, but it is not too difficult for you to implement this on your own.

0 Likes
Anonymous
Not applicable

Or you can use the higher-level APIs like wiced_gpio_init and wiced_gpio_deinit to switch back and forth between output and input

0 Likes