Program variable storage for sine table

Status
Not open for further replies.

keithbdi

Member
How do you implement on Teensy 3.2
example shown for Arduino

Declare.....
const byte sine20000[] PROGMEM = {127,.......


Read.....

wave = pgm_read_byte_near(sine20000 + sinNum);
 
you do not need to declare PROGMEM, just use const. To read from an array held as const, you would use square brackets:

value = sine20000[your location in the array];
 
You also don't need those horribly awkward pgm_read_byte_near() functions to read the data. You can access them as normal arrays. So much nicer than 8 bit AVR. :)
 
Status
Not open for further replies.
Back
Top