Arduino Universal Inputs
A collection of libraries for managing/processing input devices on Arduino.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | List of all members
LinearTransform Class Reference

Value transformation for basic linear interpolation. More...

#include <LinearTransform.h>

Inheritance diagram for LinearTransform:
Inheritance graph
[legend]
Collaboration diagram for LinearTransform:
Collaboration graph
[legend]

Public Member Functions

 LinearTransform (inputanalog_t fromLow, inputanalog_t fromHigh, inputanalog_t toLow, inputanalog_t toHigh)
 Create a new value transformation. More...
 
inputanalog_t transform (inputanalog_t raw) const
 Perform the value transformation. More...
 
- Public Member Functions inherited from IValueTransform
 IValueTransform (inputanalog_t fromLow, inputanalog_t fromHigh)
 Create a new value transformation. More...
 

Additional Inherited Members

- Protected Attributes inherited from IValueTransform
inputanalog_t m_fromLow
 Lowest input value.
 
inputanalog_t m_fromHigh
 Highest input value.
 

Detailed Description

Value transformation for basic linear interpolation.

Constructor & Destructor Documentation

LinearTransform::LinearTransform ( inputanalog_t  fromLow,
inputanalog_t  fromHigh,
inputanalog_t  toLow,
inputanalog_t  toHigh 
)
inline

Create a new value transformation.

Parameters
fromLowLowest mapped inout value
fromHighHighest mapped input value
toLowLowest mapped output value
toHighHighest mapped output value

Member Function Documentation

inputanalog_t LinearTransform::transform ( inputanalog_t  raw) const
inlinevirtual

Perform the value transformation.

Parameters
rawValue to transform
Returns
Transformed value

Performs basic linear interpolation.

Implements IValueTransform.


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