OpenSprinkler › Forums › Hardware Questions › OpenSprinkler Pi (OSPi) › How to use analog sensor data in unified firmware program › Reply To: How to use analog sensor data in unified firmware program
Ray
If you plan to modify the unified firmware to add support for analog sensor, I believe there are two ways. One is to use the system() function to make command line calls and parse the returned result. The system commands are explained at the bottom of this page:
https://rayshobby.net/announcing-opensprinkler-pi-v1-2/
The second way is to leverage wiringPi’s support for PCF8591 ADC:
http://wiringpi.com/extensions/i2c-pcf8591/
The first way is likely the easiest, although I have not tried it in the unified firmware myself. Of course you can also write an external script and use system() function to call the script that returns simple true/false values.