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.

Rotary Class

Module: rotary

Basic UPM module for the rotary angle sensor (knob) on analog. Provides a set of functions to read the absolute pin value, degrees or radians, and another set to do the same relative to the center of the knob's range.
rotary.jpg

Methods

Rotary

(
  • pin
)
Number

Rotary angle sensor constructor

Parameters:

  • pin Number

    Number of the analog pin to use

Returns:

Number:

abs_value

() Number

Gets the absolute raw value from the AIO pin

Returns:

Number:

Unsigned value from the ADC

abs_deg

() Number

Gets absolute raw degrees from the AIO pin

Returns:

Number:

Unsigned degrees from the ADC

abs_rad

() Number

Gets absolute raw radians from the AIO pin

Returns:

Number:

Unsigned radians from the ADC

rel_value

() Number

Gets the relative value from the AIO pin

Returns:

Number:

Signed value from the ADC

rel_deg

() Number

Gets relative degrees from the AIO pin

Returns:

Number:

Signed degrees from the ADC

rel_rad

() Number

Gets relative radians from the AIO pin

Returns:

Number:

Signed radians from the ADC

name

() String

Returns:

String: