Microchip | The Embedded Control Solutions Company Register Login
Browse All
Theta Engineering
 4 Code Snippets

Arbitrary function using piece-wise linear interpolaton

Theta Engineering

Here is a function for producing an output value that is an arbitrary function of the input value. I've written this function 3 or 4 times in my career now, so I hope I got it generic enough this time that I won't need to write it again! Only the first polymorphic form of the function has been implemented. Creating the other polymorphs is trivial and left as an "exercise for the reader".

About this Code Example

Further documentation is included in the header file.

This is a "pure" function which has no side effects nor specific requirements from the target platform.  The tools and target listed above are merely what the code was developed and tested on.  It ought to compile and run on any platform that supports C and floating point.

Categories

Release History

  • Nov 26, 2011

    Version: 0.0.1

    Initial contribution

Download Contact the Developer

*Required Fields

  • Current Version:0.0.1
  • Created:Nov 27, 2011
  • Updated:Feb 26, 2015
  • Downloads:4653
  • MPLAB Version:v8.63
  • C Compiler:MPLAB C32
  • Development Tools:ICD3
  • Supported Devices:PIC32

Corporate News

Resources

Stay Connected

Stay up to date with the latest news from Microchip Technology.