Page 1 of 1

ODROID C2 analogue GPIO inputs

Posted: Tuesday 24 December 2019 6:53
by lucdesmedt
Hello,

I recently installed Domoticz on my Odroid C2. Works fine, digital GPIO pins are easily accessable.

However, the Odroid C2 has 2 analogue GPIO input pins. Can somebody help me how to integrate the values of these analogue inputs into Domoticz ?

Re: ODROID C2 analogue GPIO inputs

Posted: Sunday 09 February 2020 10:18
by lucdesmedt
I found the answer myself. Create a virtual sensor (millivolt) as unit and write a lua script

commandArray = {}

file = io.open("/sys/class/saradc/ch0", "r")
io.input(file)
value = math.floor(io.read()*1700/1024)
io.close(file)

commandArray['UpdateDevice'] = '55|0|'..value..''

return commandArray