Naresh Krish
/
itracker-mbed-os-example-opt3001
Sample program on how to use the OPT3001 sensor on the RAKWirelss iTracker module
mbed-OPT3001/OPT3001.h@0:33cb2fa095df, 2018-02-12 (annotated)
- Committer:
- knaresh89
- Date:
- Mon Feb 12 05:06:24 2018 +0000
- Revision:
- 0:33cb2fa095df
Sample program on how to use the OPT3001 sensor on the RAKWireless iTracker module
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
knaresh89 | 0:33cb2fa095df | 1 | #include "mbed.h" |
knaresh89 | 0:33cb2fa095df | 2 | |
knaresh89 | 0:33cb2fa095df | 3 | //I2C address of OPT3001 on the BOOSTXL-SENSORS breakout board from TI is 0x47. |
knaresh89 | 0:33cb2fa095df | 4 | //Please change this according to your board / I2C address allocated or required for your hardware. |
knaresh89 | 0:33cb2fa095df | 5 | //mbed I2C API use 7 bit address, hence left shift the 8-bit address by 1 bit. |
knaresh89 | 0:33cb2fa095df | 6 | const int address = 0x44 << 1; |
knaresh89 | 0:33cb2fa095df | 7 | |
knaresh89 | 0:33cb2fa095df | 8 | float read_sensor(); |
knaresh89 | 0:33cb2fa095df | 9 | void read_DeviceID(); |
knaresh89 | 0:33cb2fa095df | 10 |