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.

GroveSlide Class

Module: grove
  • ID: groveslide
  • Name: Slide Potentiometer
  • Category: ainput
  • Manufacturer: seeed
  • Connection: analog

Basic UPM module for the Grove slide potentiometer on analog that returns either a raw value or a scaled voltage value.
slide.jpg

Methods

GroveSlide

(
  • pin
  • ref_voltage
)
Number

Grove analog slide potentiometer constructor

Parameters:

  • pin Number

    Number of the analog pin to use

  • ref_voltage Number

    Reference voltage the board is set to, as a floating-point value; default is 5.0V

Returns:

Number:

raw_value

() Number

Gets the raw value from the AIO pin

Returns:

Number:

Raw value from the ADC

voltage_value

() Number

Gets the voltage value from the pin

Returns:

Number:

Voltage reading based on the reference voltage

ref_voltage

() Number

Gets the board's reference voltage passed on object initialization

Returns:

Number:

Reference voltage the class was set for