upm  1.3.0
Sensor/Actuator repository for libmraa (v1.7.0)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions
Flex Class Reference

API for the Spectra Symbol Flex Sensor. More...

Detailed Description

A simple flex sensor. The resistance across the sensor increases when flexed. Patented technology by Spectra Symbol, these sensors were used in the original Nintendo* Power Glove.


Flex Sensor image provided by SparkFun* under CC BY-NC-SA-3.0.

// The was tested with a Spectra Symbol flex sensor.
// We attached a 22K resistor to a breadboard,
// with 1 end attached to GND and the other connected to
// both the flex sensor and A0.
// The flex sensor was connected on 1 pin to the 22K resistor and A0
// and on the other pin to 5V.
// Instantiate a Flex sensor on analog pin A0
upm::Flex *flex = new upm::Flex(0);
while (shouldRun)
cout << "Flex value: " << flex->value() << endl;

Public Member Functions

 Flex (int pin)
 ~Flex ()
int value ()

Constructor & Destructor Documentation

Flex ( int  pin)

Flex sensor constructor

pinAnalog pin to use
~Flex ( )

Flex sensor destructor

Member Function Documentation

int value ( )
Analog flex value

The documentation for this class was generated from the following files: