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?
3 Answers
For the GPIO libraries available on the Pi see
http://elinux.org/RPi_GPIO_Code_Samples
For C the usual choices are
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 :-)
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.
/dev
nodes, it depends on the node but it is not really pi specific and questions about this would be better off on Stack Overflow or Unix & Linux. However, a major purpose in using a file node based interface is to make it language agnostic, i.e., you are literally just reading and writing from them as if they were normal files (although they may be a bit less flexible in some ways).