|
Files | |
file | LEGOLS-driver.h |
Lego Light Sensor driver. | |
Defines | |
#define | LEGOLSDAT "legols.dat" |
Functions | |
int | LSvalRaw (tSensors link) |
int | LSvalNorm (tSensors link) |
void | LScalLow (tSensors link) |
void | LScalLow (int lowval) |
void | LScalHigh (tSensors link) |
void | LScalHigh (int highval) |
void | LSsetActive (tSensors link) |
void | LSsetInactive (tSensors link) |
int | LSvalNorm (tMUXSensor muxsensor) |
void | LScalLow (tMUXSensor muxsensor) |
int | LSvalRaw (tMUXSensor muxsensor) |
void | LScalHigh (tMUXSensor muxsensor) |
void | LSsetActive (tMUXSensor muxsensor) |
void | LSsetInactive (tMUXSensor muxsensor) |
void | _LScheckSensor (tSensors link) |
void | _LSwriteCalVals (int lowval, int highval) |
void | _LSreadCalVals (int &lowval, int &highval) |
Variables | |
int | lslow = 0 |
int | lshigh = 1023 |
bool | legols_calibrated = false |
Light Sensor
#define LEGOLSDAT "legols.dat" |
Datafile for Light Sensor calibration info
Definition at line 41 of file LEGOLS-driver.h.
void _LScheckSensor | ( | tSensors | link ) |
Check if the sensor is set to raw and that it's been configured as a LightActive or Inactive sensor. If not, set the default to sensorLightInActive.
Note: this is an internal function and should not be called directly
link | the Light Sensor port number |
Definition at line 263 of file LEGOLS-driver.h.
void _LSreadCalVals | ( | int & | lowval, |
int & | highval | ||
) |
Read the low and high calibration values from a data file.
Note: this is an internal function and should not be called directly
lowval | the low calibration value |
highval | the high calibration value |
Definition at line 338 of file LEGOLS-driver.h.
void _LSwriteCalVals | ( | int | lowval, |
int | highval | ||
) |
Write the low and high calibration values to a data file.
Note: this is an internal function and should not be called directly
lowval | the low calibration value |
highval | the high calibration value |
Definition at line 279 of file LEGOLS-driver.h.
void LScalHigh | ( | tSensors | link ) |
Calibrate the Light Sensor's high calibration value with the current raw sensor reading.
link | the Light Sensor port number |
Definition at line 182 of file LEGOLS-driver.h.
void LScalHigh | ( | tMUXSensor | muxsensor ) |
Calibrate the Light Sensor's high calibration value with the current raw sensor reading.
muxsensor | the SMUX sensor port number |
Definition at line 195 of file LEGOLS-driver.h.
void LScalHigh | ( | int | highval ) |
Calibrate the Light Sensor's high calibration value with the supplied value.
highval | the sensor's high calibration value |
Definition at line 206 of file LEGOLS-driver.h.
void LScalLow | ( | tSensors | link ) |
Calibrate the Light Sensor's low calibration value with the current raw sensor reading.
link | the Light Sensor port number |
Definition at line 148 of file LEGOLS-driver.h.
void LScalLow | ( | int | lowval ) |
Calibrate the Light Sensor's low calibration value with the supplied value.
lowval | the sensor's low calibration value |
Definition at line 172 of file LEGOLS-driver.h.
void LScalLow | ( | tMUXSensor | muxsensor ) |
Calibrate the Light Sensor's low calibration value with the current raw sensor reading.
muxsensor | the SMUX sensor port number |
Definition at line 161 of file LEGOLS-driver.h.
void LSsetActive | ( | tMUXSensor | muxsensor ) |
Configure the sensor as a LightActive sensor
muxsensor | the SMUX sensor port number |
Definition at line 228 of file LEGOLS-driver.h.
void LSsetActive | ( | tSensors | link ) |
Configure the sensor as a LightActive sensor
link | the Light Sensor port number |
Definition at line 216 of file LEGOLS-driver.h.
void LSsetInactive | ( | tSensors | link ) |
Configure the sensor as a LightInactive sensor
link | the Light Sensor port number |
Definition at line 238 of file LEGOLS-driver.h.
void LSsetInactive | ( | tMUXSensor | muxsensor ) |
Configure the sensor as a LightInactive sensor
muxsensor | the SMUX sensor port number |
Definition at line 250 of file LEGOLS-driver.h.
int LSvalNorm | ( | tSensors | link ) |
Read the normalised value of the Light Sensor, based on the low and high values.
link | the Light Sensor port number |
Definition at line 100 of file LEGOLS-driver.h.
int LSvalNorm | ( | tMUXSensor | muxsensor ) |
Read the normalised value of the Light Sensor, based on the low and high values.
muxsensor | the SMUX sensor port number |
Definition at line 126 of file LEGOLS-driver.h.
int LSvalRaw | ( | tMUXSensor | muxsensor ) |
Read the raw value of the Light Sensor.
muxsensor | the SMUX sensor port number |
Definition at line 90 of file LEGOLS-driver.h.
int LSvalRaw | ( | tSensors | link ) |
Read the raw value of the Light Sensor.
link | the Light Sensor port number |
Definition at line 77 of file LEGOLS-driver.h.
bool legols_calibrated = false |
Has the sensor been calibrated yet
Definition at line 46 of file LEGOLS-driver.h.
int lshigh = 1023 |
High calibration value
Definition at line 45 of file LEGOLS-driver.h.
int lslow = 0 |
Low calibration value
Definition at line 44 of file LEGOLS-driver.h.