Context: I am working on using the adafruit plasma code for a 16x16 physical array of RGB LEDs using LPD8806 strips. [See https://github.com/adafruit/RGB-matrix-Panel/tree/master/examples/plasma_16x32 for the original.]
Here's my more general technical question about using PROGMEM on the Teensy 3.0. I want to store and read from a fairly large array held in PROGMEM: 4096 int16_t elements. When I try to upload my code to the Teensy 3.0, it crashes and the Teensy no longer shows up under the Arduino IDE Tools>Serial Port menu. I can reboot the Teensy and successfully load a different sketch, but this particular sketch consistently causes a crash. I wonder if it has something to do with the amount of data being written to PROGMEM? Or maybe that the Teensy 3.0 is not AVR-based?
My sketch uses:
I initialize the array with:
I read from the array with:
I've attached my entire sketch.
Thanks in advance for any help you might be able to offer.
Bongo
Here's my more general technical question about using PROGMEM on the Teensy 3.0. I want to store and read from a fairly large array held in PROGMEM: 4096 int16_t elements. When I try to upload my code to the Teensy 3.0, it crashes and the Teensy no longer shows up under the Arduino IDE Tools>Serial Port menu. I can reboot the Teensy and successfully load a different sketch, but this particular sketch consistently causes a crash. I wonder if it has something to do with the amount of data being written to PROGMEM? Or maybe that the Teensy 3.0 is not AVR-based?
My sketch uses:
#include <avr/pgmspace.h>
to make use of the PROGMEM and pgm_read_xxx functions.I initialize the array with:
static int16_t sinetab[4096] PROGMEM = {lots of values here}
I read from the array with:
(int16_t)pgm_read_word(sinetab + offset)
I am using read_word rather than read_byte because my array is storing 16-bit integers.I've attached my entire sketch.
Thanks in advance for any help you might be able to offer.
Bongo