|
Files | |
file | lego-light.h |
Lego Light Sensor driver. | |
Defines | |
#define | LEGOLSDAT "legols.dat" |
Functions | |
int | LSvalRaw (tSensors link) |
int | LSvalNorm (tSensors link) |
void | LScalLow (tSensors link) |
void | LScalHigh (tSensors link) |
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 () |
void | _LSreadCalVals () |
Variables | |
int | lslow [16] |
int | lshigh [16] |
bool | legols_calibrated = false |
Light Sensor
#define LEGOLSDAT "legols.dat" |
Datafile for Light Sensor calibration info
Definition at line 42 of file lego-light.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 245 of file lego-light.h.
void _LSreadCalVals | ( | ) |
Read the low and high calibration values from a data file.
Note: this is an internal function and should not be called directly
Definition at line 322 of file lego-light.h.
void _LSwriteCalVals | ( | ) |
Write the low and high calibration values to a data file.
Note: this is an internal function and should not be called directly
Definition at line 259 of file lego-light.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 187 of file lego-light.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 174 of file lego-light.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 163 of file lego-light.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 150 of file lego-light.h.
void LSsetActive | ( | tSensors | link ) |
Configure the sensor as a LightActive sensor
link | the Light Sensor port number |
Definition at line 198 of file lego-light.h.
void LSsetActive | ( | tMUXSensor | muxsensor ) |
Configure the sensor as a LightActive sensor
muxsensor | the SMUX sensor port number |
Definition at line 210 of file lego-light.h.
void LSsetInactive | ( | tMUXSensor | muxsensor ) |
Configure the sensor as a LightInactive sensor
muxsensor | the SMUX sensor port number |
Definition at line 232 of file lego-light.h.
void LSsetInactive | ( | tSensors | link ) |
Configure the sensor as a LightInactive sensor
link | the Light Sensor port number |
Definition at line 220 of file lego-light.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 128 of file lego-light.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 102 of file lego-light.h.
int LSvalRaw | ( | tSensors | link ) |
Read the raw value of the Light Sensor.
link | the Light Sensor port number |
Definition at line 79 of file lego-light.h.
int LSvalRaw | ( | tMUXSensor | muxsensor ) |
Read the raw value of the Light Sensor.
muxsensor | the SMUX sensor port number |
Definition at line 92 of file lego-light.h.
bool legols_calibrated = false |
Has the sensor been calibrated yet
Definition at line 50 of file lego-light.h.
int lshigh[16] |
Definition at line 45 of file lego-light.h.
int lslow[16] |
Definition at line 44 of file lego-light.h.