DpClass1
objectPage http://www.yama-lab.org/dp-1/index.php?HexTestEx1 or http://www.yama-lab2.org/dp-1/index.php?HexTestEx2
device yamaRasPiDp9_1 or yamaRasPiDp9_2 start after no write for 10 min.
command: set readInterval=30000
command: set execInterval=0
command: program hex
program: ex("pi4j", "i2c use 1")
program: ex("pi4j", "i2c write2 0x29,0x80,0x03") 'power up the tsl2561 lux sensor
program: ex("pi4j", "i2c write2 0x29,0x81,0x00")
program: ex("pi4j", "i2c write2 0x29,0x86,0x00") 'scale
program: ex("pi4j", "i2c write2 0x29,0x80,0x00") 'power down
program: ex("pi4j", "i2c write2 0x29,0x80,0x03") ' power up again
program: v1=ex("pi4j", "i2c read1 0x29,")
program: ex("
program: ex("service","putSendBuffer date="+ex("service","getCurrentDate.")+",x="+x);
program: ex("service","sendResults.")
command: end hex
command: run hex
result:
date=2016/9/22/ 20:54:24,x=161
date=2016/9/22/ 20:54:29,x=161
date=2016/9/22/ 20:54:59,x=161
date=2016/9/22/ 20:55:29,x=161
date=2016/9/22/ 20:56:0,x=161
date=2016/9/22/ 20:56:30,x=161
date=2016/9/22/ 20:57:0,x=161
date=2016/9/22/ 20:57:30,x=161
date=2016/9/22/ 20:58:0,x=161
currentDevice="yamaRasPiDp1_1",Date=2016/9/22/ 20:58:0