[[FrontPage]]
 objectPage http://www.yama-lab.org/fwb4pi/index.php?i2c-veml6075 or http://www.yama-lab.org/fwb4pi/index.php?i2c-veml6075
 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 i2cVeml6075
 program: '
 program: ' init i2c
 program: ex("pi4j", "i2c use 1")
 program: '
 program: ' init veml6075
 program: ex("pi4j", "i2c write2 0x10,0x00,0x00,0x10") ' config
 program: '
 program: 'get ultra violet lux
 program: uvas=ex("pi4j", "i2c read2 0x10,0x07") ' uva_raw
 program: uvaw=s2i(uvas)
 program: uva=(0x00ff & uvaw)*256+uvaw/256
 program: uvbs=ex("pi4j", "i2c read2 0x10,0x09") ' uvb_raw
 program: uvbw=s2i(uvbs)
 program: uvb=(0x00ff & uvbw)*256+uvbw/256
 program: uvc1=ex("pi4j", "i2c read2 0x10,0x0a") ' uvcomp1
 program: uvc2=ex("pi4j", "i2c read2 0x10,0x0b") ' uvcomp2
 program: uvaCalc = uva - 2.22 * s2i(uvc1) - 1.33 * s2i(uvc2)
 program: uvbCalc = uvb - 2.95 * s2i(uvc1) - 1.74 * s2i(uvc2)
 program: '
 program: '
 program: ex("pi4j", "i2c close.")
 program: 'ex("service","clear sendBuffer")
 program: ex("service","putSendBuffer device=uva, Date="+ex("service","getCurrentDate.")+", v="+uvaCalc)
 program: ex("service","putSendBuffer device=uvb, Date="+ex("service","getCurrentDate.")+",v="+uvbCalc)
 program: ex("service","sendResults.")
 command: end i2cVeml6075
 command: run i2cVeml6075
 result:
 device=uva, Date=2019/3/21/ 19:10:10, v=65283.55
 device=uvb, Date=2019/3/21/ 19:10:10,v=65284.689999999995
 device=uva, Date=2019/3/21/ 19:10:39, v=65283.55
 device=uvb, Date=2019/3/21/ 19:10:39,v=65284.689999999995
 device=uva, Date=2019/3/21/ 19:11:9, v=65283.55
 device=uvb, Date=2019/3/21/ 19:11:9,v=65284.689999999995
 device=uva, Date=2019/3/21/ 19:11:39, v=65283.55
 device=uvb, Date=2019/3/21/ 19:11:39,v=65284.689999999995
 currentDevice="yamaRasPiDp1_1",Date=2019/3/21/ 19:11:39

 device=uva, Date=2019/3/21/ 19:12:9, v=65283.55
 device=uvb, Date=2019/3/21/ 19:12:9,v=65284.689999999995
 currentDevice="yamaRasPiDp1_1",Date=2019/3/21/ 19:12:9


トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS