Sub Process_Globals
Public Serial1 As Serial
Private bh As BH1750FVI
Private Timer1 As Timer
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
'Init the sensor with low I2C address 0x23 and the recommended high resolution mode
bh.Initialize(bh.Device_Address_L, bh.Continuous_H_resolution_Mode)
Timer1.Initialize("Timer1_Tick", 1000)
Timer1.Enabled = True
End Sub
Sub Timer1_Tick
Log(bh.LightIntensity, "lx")
End Sub