upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Member Functions

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.jpg


Flex Sensor image provided by SparkFun* under CC BY 2.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(0);
while (shouldRun) {
cout << "Flex value: " << flex.value() << endl;
upm_delay(1);
}

Public Member Functions

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

Constructor & Destructor Documentation

Flex ( int  pin)

Flex sensor constructor

Parameters
pinAnalog pin to use
~Flex ( )

Flex sensor destructor

Member Function Documentation

int value ( )
Returns
Analog flex value

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