1

I am teaching a child C programming with the RPi using a project with the DHT 11. I'm coming from Python and Node on the RPi but haven't done I/O on the RPi in C. What are some available libraries we could use, where would I find them, and what are their benefits?

goldilocks
  • 60,325
  • 17
  • 117
  • 234
mlhDev
  • 199
  • 1
  • 2
  • 8

3 Answers3

4

For the GPIO libraries available on the Pi see

http://elinux.org/RPi_GPIO_Code_Samples

For C the usual choices are

joan
  • 71,852
  • 5
  • 76
  • 108
1

Personally I'd go with the bcm2835 library as its closest to the hardware. If you want to work with a DHT11 then see: A Custom Protocol - The DHT11/22

Which covers the entire how to use the DHT22 in more detail than you could ever need :-)

Mike James
  • 146
  • 1
0

Use WiringPi - http://wiringpi.com/ - it has a simplified API, but that's entirely optional... you can do everything you can do in C/C++.

The documentation and examples are excellent.

user400344
  • 264
  • 2
  • 4