|
upm
1.5.0
Sensor/Actuator repository for libmraa (v1.8.0)
|
API for the Voltage Divider Sensor. More...
UPM module for the Voltage Divider sensor
Public Member Functions | |
| VDiv (int pin) | |
| ~VDiv () | |
| unsigned int | value (unsigned int samples) |
| float | computedValue (uint8_t gain, unsigned int val, int vref=VDIV_VREF, int res=VDIV_ADC_RES) |
| VDiv | ( | int | pin | ) |
Voltage Divider sensor constructor
| pin | Analog pin to use |
| ~VDiv | ( | ) |
Voltage Divider destructor
| unsigned int value | ( | unsigned int | samples | ) |
Gets the conversion value from the sensor
| samples | Specifies how many samples to average over |
| float computedValue | ( | uint8_t | gain, |
| unsigned int | val, | ||
| int | vref = VDIV_VREF, |
||
| int | res = VDIV_ADC_RES |
||
| ) |
Computes the measured voltage
| gain | Gain switch, example: either 3 or 10 grove vdiv |
| val | Measured voltage (from value()) |
| vref | Reference voltage in millivolts |
| res | ADC resolution |
1.8.11