I’m wiritng a program to output some data to a DAC, and I’m using an AtMega328.
I was looking at this code to determine how to use PROGMEM and work with interrupts:
But when I included sounddata.h into my program, and ran a test compile, my binary sketch size didn’t go up at all, let alone by the 10000 bytes of data the sounddata array contains.
I tried adding:
int lastSample = pgm_read_byte(&sounddata_data[sounddata_length-1]);
Into my code to make sure the compiler wasn’t just optimizing the data away because it was never accessed, but no dice.
I also added:
To the top of my code, but the compiler didn’t complain when I used the PROGMEM keyword or the function to read the data without that in place. So I wonder if that is even needed?
So what’s going on here? Does PROGMEM data not show up in the binary sketch size? Or is the data actually missing? I haven’t gotten to the point in my code yet where I can output the sound, so I don’t know if the data’s there, but I guess I’ll output it over the serial connection or something to find out in a few minutes.