|
upm
0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
|
API for the Grove Voltage Divider Sensor. More...
UPM module for the Grove Voltage Divider sensor
Public Member Functions | |
| synchronized void | delete () |
| GroveVDiv (int pin) | |
| long | value (long samples) |
| float | computedValue (short gain, long val, int vref, int res) |
| float | computedValue (short gain, long val, int vref) |
| float | computedValue (short gain, long val) |
| GroveVDiv | ( | int | pin | ) |
Grove Voltage Divider sensor constructor
| pin | Analog pin to use |
| float computedValue | ( | short | gain, |
| long | val, | ||
| int | vref, | ||
| int | res | ||
| ) |
Computes 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 |
| long value | ( | long | samples | ) |
Gets the conversion value from the sensor
| samples | Specifies how many samples to average over |
1.8.9.1