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.

Slide Class

Module: slide

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

Methods

Slide

(
  • pin
  • ref_voltage
)
Number

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

name

() String

Returns:

String: