pyupm_grovevdiv module

class pyupm_grovevdiv.GroveVDiv(pin)[source]

Bases: object

API for the Grove Voltage Divider Sensor.

Deprecated This class is being replaced by VDiv

ID: grovevdiv

Name: Voltage Divider

Category: electric

Manufacturer: seeed

Connection: analog

Kit: robok UPM module for the Grove Voltage Divider sensor

C++ includes: grovevdiv.hpp

computedValue(gain, val, vref=4980, res=1024)[source]

float computedValue(uint8_t gain, unsigned int val, int vref=GROVEVDIV_VREF, int res=GROVEVDIV_ADC_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

Measured voltage

value(samples)[source]

unsigned int value(unsigned int samples)

Gets the conversion value from the sensor

samples: Specifies how many samples to average over

Average ADC conversion value