I have the following array:
PROGMEM prog_uint16_t show_hide_info[] = { 4216, 8900, 4380, 580, 500, 600, 500, 580, 1620, 580, 500, 600, 500, 580, 500, 600, 480, 600, 500, 580, 1620, 580, 1620, 600, 500, 580, 1620, 580, 1620, 600, 1600, 600, 1620, 580, 1620, 600, 500, 580, 1620, 580, 500, 600, 1600, 600, 500, 580, 1620, 580, 500, 600, 1620, 580, 1620, 600, 480, 600, 1620, 580, 500, 600, 1600, 600, 500, 580, 1620, 580, 500, 600, 39300, 8860, 2160, 580, 0 };
I'd like to be able to loop through this array and execute the following methods accordingly:
pulseIR(4216);
delayMicroseconds(8900);
pulseIR(4380);
delayMicroseconds(580);
...
This is what I have so far, which is obviously way off track:
unsigned int* get(prog_uint16_t code[]) {
unsigned int c;
while ((c = pgm_read_word(code++))) {
//pulseIR(c); ??
//delayMicroseconds(c+1); ??
}
}
Not quite sure what I'm meant to be doing with c to be honest.
Due to lack of sleep, I can't for the life of me make sense of the following documentation on PROGMEM: