mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-20 14:39:00 +00:00
Added driver for BH1750 digital ambient light sensor (#15)
* Added driver for BH1750 digital ambient light sensor
This commit is contained in:
committed by
Ron Evans
parent
31bc74101d
commit
693e7a1db7
@@ -0,0 +1,24 @@
|
||||
package bh1750
|
||||
|
||||
// Constants/addresses used for I2C.
|
||||
|
||||
// The I2C address which this device listens to.
|
||||
const Address = 0x23
|
||||
|
||||
// Registers. Names, addresses and comments copied from the datasheet.
|
||||
const (
|
||||
POWER_DOWN = 0x00
|
||||
POWER_ON = 0x01
|
||||
RESET = 0x07
|
||||
CONTINUOUS_HIGH_RES_MODE SamplingMode = 0x10
|
||||
CONTINUOUS_HIGH_RES_MODE_2 SamplingMode = 0x11
|
||||
CONTINUOUS_LOW_RES_MODE SamplingMode = 0x13
|
||||
ONE_TIME_HIGH_RES_MODE SamplingMode = 0x20
|
||||
ONE_TIME_HIGH_RES_MODE_2 SamplingMode = 0x21
|
||||
ONE_TIME_LOW_RES_MODE SamplingMode = 0x23
|
||||
|
||||
// resolution in 10*lx
|
||||
HIGH_RES = 10
|
||||
HIGH_RES2 = 5
|
||||
LOW_RES = 40
|
||||
)
|
||||
Reference in New Issue
Block a user