Go to the documentation of this file.
22 #ifndef _LightSensor_H_
23 #define _LightSensor_H_
28 #if defined(CONF_DSENSOR)
69 unsigned int sample(
unsigned int size = 10,
int wait = 2)
const {
70 if (size == 0) size = 1;
71 unsigned int sum(
get());
72 for (
unsigned int i = 1; i < size; ++i) {
81 #warning Enable CONF_DSENSOR to use LightSensor.H
82 #endif // CONF_DSENSOR
83 #endif // _LightSensor_H_
void delay(unsigned ms)
delay approximately ms mSec
volatile unsigned int & sensor
The address of our sensor value.
unsigned int sample(unsigned int size=10, int wait=2) const
Get the average of {size} samples, waiting {wait} mSec between each sample.
LightSensor(const Sensor::Port port)
Instance an active light sensor at {port}.
unsigned int get() const
Get the current lightSensor value.
C++ Sensor Class Interface.
Port
List of sensor identifiers (IDs).
#define LIGHT(a)
map light sensor to 0..LIGHT_MAX
Generated for brickOS C++ by
1.8.16