FrontPage
objectPage http://www.yama-lab.org/fwb4pi/index.php?i2c-hdc1080-1 or http://www.yama-lab.org/fwb4pi/index.php?i2c-hdc1080-1
device yamaRasPiDp9_1 or yamaRasPiDp9_2 start after no write for 10 min.
command: set readInterval=30000
command: set execInterval=0
command: set reportLength=120
command: program i2cHdc1080
program: '
program: ' init i2c
program: ex("pi4j", "i2c use 1")
program: '
program: ' init hdc1080
program: ex("pi4j", "i2c write2 0x40,0x02,0x10,0x00") ' config
program: '
program: 'get temp
program:v1s= ex("pi4j", "i2c read2 0x40,0x00") ' temp
program: temp=s2i(v1s)/65536.0*165-40
program: '
program: 'get humidity
program: v2s=ex("pi4j", "i2c read2 0x40,0x01") 'humid
program: humid=s2i(v2s)/65536.0*100
program: '
program: ex("pi4j", "i2c close.")
program: 'ex("service","clear sendBuffer")
program: ex("service","putSendBuffer device=temp, Date="+ex("service","getCurrentDate.")+", v="+temp)
program: ex("service","putSendBuffer device=humid, Date="+ex("service","getCurrentDate.")+",v="+humid)
program: ex("service","sendResults.")
command: end i2cHdc1080
command: run i2cHdc1080
result:
device=temp, Date=2019/3/21/ 19:29:52, v=-40.00251770019531
device=humid, Date=2019/3/21/ 19:29:52,v=-0.00152587890625
device=temp, Date=2019/3/21/ 19:30:21, v=-40.00251770019531
device=humid, Date=2019/3/21/ 19:30:21,v=-0.00152587890625
currentDevice="yamaRasPiDp1_1",Date=2019/3/21/ 19:30:21