I did this recently on a few others sketches and still works on those but does not work on my new project or this MCVE
const uint8_t PROGMEM clock_set_arrow_display[] = {1,1,1,1, 9, 2,2, 9, 3,3, 9, 4,4, 9, 5,5, 9,9,9,9};
uint8_t clock_idx=1;
void display_clock_set()
{
uint8_t x;
Serial.print(clock_idx); Serial.print(": ");
for (x=0; x<20; x++)
{
Serial.print(clock_set_arrow_display[x]);
if (clock_set_arrow_display[x] == clock_idx)
{
// Serial.print("x");
}
else
{
// Serial.print(" ");
}
}
Serial.println();
}
void setup() {
Serial.begin(115200);
display_clock_set();
}
void loop() {
// put your main code here, to run repeatedly:
}
The output is
1: 00128000100128128128128128128128001350
The output should be
1: 11119229339449559999
The implementation in this sketch works:
const uint8_t PROGMEM display_arrow[] = {1,1,1,1, 0, 2,2, 0, 3,3, 9, 4,4, 9, 5,5, 9, 6,6, 9};
void display_clock_set()
{
uint8_t x;
for (x=0; x<20; x++)
{
if (display_arrow[x] == clock_idx)
{ lcd.write(arrow_rt); } // print custom cursor arrow
else
{ lcd.write(" "); }
}
}
Why does it work on those sketches (copy and paste) and not on this one?