[[FrontPage]] objectPage http://www.yama-lab.org/fwb4pi/index.php?i2c-opt3001-1 or http://www.yama-lab.org/fwb4pi/index.php?i2c-opt3001-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 i2cOpt3001 program: ' program: ' init i2c program: ex("pi4j", "i2c use 1") program: ' program: ' init opt3001 program: ex("pi4j", "i2c write2 0x44,0x01,0xcc,0x01") ' config program: delay(10) program: ' program: 'get lux program: ex("pi4j", "i2c write-b 0x44,0x00") ' raw-lax program: delay(300) program: v1s=ex("pi4j", "i2c read-A-2 0x44") ' get raw-lax program: 'v1s=ex("pi4j", "i2c read2 0x44,0x00") program: luxw1=(s2i(v1s) /(2^12)) & 0x000f program: luxw2=s2i(v1s) & 0x0fff program: lux=luxw2*(2^luxw1) program: ' program: ex("pi4j", "i2c close.") program: 'ex("service","clear sendBuffer") program: ex("service","putSendBuffer device=lux, Date="+ex("service","getCurrentDate.")+", v="+lux) program: ex("service","sendResults.") command: end i2cOpt3001 command: run i2cOpt3001 result: device=lux, Date=2019/2/20/ 20:20:29, v=0 currentDevice="yamaRasPiDp1_1",Date=2019/2/20/ 20:20:29 device=lux, Date=2019/2/20/ 20:20:58, v=0 currentDevice="yamaRasPiDp1_1",Date=2019/2/20/ 20:20:58