Driver for the Texas Instruments OPT3001 Optical Sensor.
Driver include
This header file should be included in an application as follows:
#include "stdint.h"
#include "stdbool.h"
Go to the source code of this file.
§ SensorOpt3001_init()
bool SensorOpt3001_init |
( |
void |
| ) |
|
Initialize the temperature sensor driver.
- Returns
- true if initialization succeeds
§ SensorOpt3001_enable()
void SensorOpt3001_enable |
( |
bool |
enable | ) |
|
Enable/disable measurement cycle.
- Parameters
-
enable | - flag to turn the sensor on/off |
§ SensorOpt3001_test()
bool SensorOpt3001_test |
( |
void |
| ) |
|
Run a sensor self-test.
- Returns
- true if passed
§ SensorOpt3001_read()
bool SensorOpt3001_read |
( |
uint16_t * |
rawData | ) |
|
Read the result register.
- Parameters
-
- Returns
- true if valid data
§ SensorOpt3001_convert()
float SensorOpt3001_convert |
( |
uint16_t |
rawData | ) |
|
Convert raw data to LUX.
- Parameters
-
rawData | - raw data from sensor |
- Returns
- converted value (lux)