Hello all, been hanging out for sometime here.
Finally went and got my self an arduino. I have been having fun learning quit a bit on some of the stuff it can do. Over the last few days i have started making a controller for a little project.
I got stuck trying to figure out how to interpolate values in a table.
I am using Flash.h as i find progmem to be a big pain.
FLASH_TABLE(int, font_table, 8 /* width of table */,
{100, 100, 100, 100, 90, 80, 80, 70}, // 100 %
{100, 100, 100, 100, 100, 90, 80, 80}, // 50 %
{100, 100, 100, 100, 100, 100, 100, 100}, // 40 %
{100, 100, 100, 100, 100, 100, 100, 100}, // 30 %
{100, 100, 100, 100, 100, 100, 100, 100}, // 20 %
{100, 100, 100, 100, 100, 100, 100, 100}); // 10 %
/* 2 3 4 5 6 7 8 9
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
*/
I can get the value of an intersection very easily but doing
font_table[tps][rpm]) ;
The value will work out duty cycle for an output.
But i am having a hard time trying to interpolate between them.
Dos anyone have a word of wisdom.