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.

VDiv Class

Module: vdiv
  • ID: vdiv
  • Name: Analog Voltage Divider Sensor
  • Other Names: Grove Voltage Divider
  • Category: electric
  • Manufacturer: seeed
  • Connection: analog
  • Kit: robok

UPM module for the Voltage Divider sensor
vdiv.jpg

Item Index

Methods

VDiv

(
  • pin
)
Number

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, example: either 3 or 10 grove vdiv

  • val Number

    Measured voltage (from value() )

  • vref Number

    Reference voltage in millivolts

  • res Number

    ADC resolution

Returns:

Number:

Measured voltage