|
upm
0.2.0
Sensor/Actuator repository for libmraa (v0.6.1)
|
C++ API for the Grove Voltage Divider Sensor. More...
UPM module for the Grove Voltage Divider Sensor
Public Member Functions | |
| GroveVDiv (int pin) | |
| ~GroveVDiv () | |
| unsigned int | value (unsigned int samples) |
| float | computedValue (uint8_t gain, uint16_t val, int vref=GROVEVDIV_VREF, int res=GROVEVDIV_ADC_RES) |
| unsigned int value | ( | unsigned int | samples | ) |
Get the conversion value from the sensor
| samples | specifies how many samples to average over |
| float computedValue | ( | uint8_t | gain, |
| uint16_t | val, | ||
| int | vref = GROVEVDIV_VREF, |
||
| int | res = GROVEVDIV_ADC_RES |
||
| ) |
Compute the measured voltage
| gain | gain switch, either 3 or 10 for grove |
| val | measured voltage (from value()) |
| vref | reference voltage in millivolts |
| res | ADC resolution |
1.8.9.1