Code Module: Graph Lookup

Jeremy Leach

Senior Member
This module allows lookup of Y-values from a 'graph' from a known X-value. The graph is stored in EEPROM as a series of points at evenly-spaced X values. When the given X value is between stored points, the code interpolates the Y-Value, assuming a straight line between the points.

This module is based on my method for writing modular code on a 28X1 referred to in another thread.

The code includes an example for ArcTan, but you can put in your own data. It also has the ability to reference multiple graphs.

Creating the data is best carefully done in a spreadsheet.
 

Attachments

This module allows lookup of Y-values from a 'graph' from a known X-value. The graph is stored in EEPROM as a series of points at evenly-spaced X values. When the given X value is between stored points, the code interpolates the Y-Value, assuming a straight line between the points.
This module is based on my method for writing modular code on a 28X1 referred to in another thread.
The code includes an example for ArcTan, but you can put in your own data. It also has the ability to reference multiple graphs.
Creating the data is best carefully done in a spreadsheet.
did not understand ...
As you might implement this routine to plot such a sign reading by the ADC? My idea was to implement a SV2000 and develop an experimental oscilloscope.
 

Jeremy Leach

Senior Member
Hi, I don't understand what your requirement is, so if you can explain it in a bit more detail then maybe the forum can help.

This code module is just a lookup using stored graphs. Because the code is quite involved it won't be the fastest code either.
 
Excellent, I'm sorry for misinterpreting your post, my English is not very good and is to interpret otherwise.
I open a new topic on this issue to see if something can be viable; My idea was to create a graphic signal, video output to a PAL TV, bony, with this we could have a foot in the issue of creating homemade oscilloscope
 
Top