Monday, December 3, 2012

GPIO Pins on the Adafruit Pi Cobbler

I posted the code for the program I used over in the Adafruit Forums:  Raspberry Pi Home Datalogger (new window)

I'm cleaning the project up a little bit.  I'm trying to make the code "nicer" and easier to follow (I should comment my code.... one of these days).  I switched the code that runs the programs over time to a system that checks the time every second, executing specified code at the top of the minute (Poll the temperature and pressure sensors), and at the top of the hour.  It works, but my system utilization never drops below 60%, and is frequently at 97%.  I may have to go back to having the system "sleep" in between sensor checks.  I think that's a bad way to do it, but I'd like to look at having these little nodes be battery and/or solar powered.

I messed around with the RPIO program I was screwing around with.  I wanted to see which RPIO reported pins correlated with which pins labeled on the Cobbler T-Plate.
The chart is repeated over on the Adafruit forums, in the comments section of the code.
Cobbler RPIO
#4------ 7
#17----- 11
#18 -----12
#21 -----V1 13
#22 -----15
#23 -----16
#24 -----18
#25 -----22
#27 -----V2 13


Tim said...

This was exactly what I was looking for. Thanks for posting this!

Static said...

You're welcome! Thanks for letting me know it was useful.
I'm thinking about writing some code to let users query pins just by specifying which ones they're trying to examine. Feed the function "Cobbler 14" or "RPIO 12" and it spits out the pin state.

I've been stuck trying to figure out how to get a thermal sensor working over I2C. That's been a lot more involved.

Good luck!