FrontPage

objectPage http://www.yama-lab.org/fwb4pi/index.php?Sensors2 or http://www.yama-lab2.org/fwb4pi/index.php?Sensors2
device yamaRasPiDp9_1 or yamaRasPiDp9_2 start after no write for 10 min.
command: set readInterval=15000
command: set execInterval=0
command: program Sensors
program: '
program: ' init i2c
program: ex("pi4j", "i2c use 1")
program: '
program: ' init lux sensor 
program: ex("pi4j", "i2c write1 0x29,0x80,0x03") 'power up the tsl2561 lux sensor
program: ex("pi4j", "i2c write1 0x29,0x81,0x00")
program: ex("pi4j", "i2c write1 0x29,0x86,0x00") 'scale
program: ex("pi4j", "i2c write1 0x29,0x80,0x00") 'power down
program: ex("pi4j", "i2c write1 0x29,0x80,0x03") ' power up again
program: delay(50)
program: '
program: 'get the lux value
program: v1=ex("pi4j", "i2c read1 0x29,0x8c")
program: v2=ex("pi4j", "i2c read1 0x29,0x8d")
program: lux=s2i(v2)*256+s2i(v1)
program: '
program: v1=ex("pi4j", "i2c read1 0x48,0x00")
program: tmp=s2i(v1)
program: '
program: ex("pi4j", "i2c close.")
program: ex("service","clear sendBuffer")
program: ex("service","putSendBuffer device=light, Date="+ex("service","getCurrentDate.")+", v="+lux)
program: ex("service","putSendBuffer device=temp, Date="+ex("service","getCurrentDate.")+", v="+tmp)
program: ex("service","sendResults.")
command: end Sensors
command: run Sensors
result:
device=light, Date=2016/10/10/ 4:3:58, v=32
device=temp, Date=2016/10/10/ 4:3:58, v=29
currentDevice="yamaRasPiDp1_1",Date=2016/10/10/ 4:3:58

トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS