UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

GroveVDiv Class

Module: grovevdiv
  • ID: grovevdiv
  • Name: Voltage Divider
  • Category: electric
  • Manufacturer: seeed
  • Connection: analog
  • Kit: robok

UPM module for the Grove Voltage Divider sensor
grovevdiv.jpg

Item Index

Methods

GroveVDiv

(
  • pin
)
Number

Grove Voltage Divider sensor constructor

Parameters:

  • pin Number

    Analog pin to use

Returns:

Number:

value

(
  • samples
)
Number

Gets the conversion value from the sensor

Parameters:

  • samples Number

    Specifies how many samples to average over

Returns:

Number:

Average ADC conversion value

computedValue

(
  • gain
  • val
  • vref
  • res
)
Number

Computes the measured voltage

Parameters:

  • gain Number

    Gain switch, either 3 or 10 for Grove

  • val Number

    Measured voltage (from value() )

  • vref Number

    Reference voltage in millivolts

  • res Number

    ADC resolution

Returns:

Number:

Measured voltage