Daft question: Read Analog input
-
Howdy,
Daft question, does anyone have a simple solution to reading an analog input value via a GPIO pin, eg a photoresistor between VCC & a 10K Ohm resistor?
Matt
-
@Matt-Ogborne Unfortunately, not really. There has been some discussion on this and the Omega people have suggested they might some time in the future produce an A/D expansion but i wouldn't hold my breath on this - see https://community.onion.io/topic/390/is-there-any-way-to-read-analogue-input-with-the-omega for the original discussion.
One current option is to use the Arduino Expansion but this adds a whole level of additional complexity.
If accuracy and speed is not of concern to you, one way of doing it involves timing how long it takes to charge a capacitor. There is information on the general principle for doing this at http://www.raspberrypi-spy.co.uk/2012/08/reading-analogue-sensors-with-one-gpio-pin/ - this is for the Raspberry PI but I'm pretty sure the technique could be adapted for the Omega.