Dear, i have problem when switching through this two partial parts of the epd.
Display is messed up.
What am i missing here in these two functions?
btw .setPartialWindow is working ok, when selected once and not changed.
regards
void loop() {
einkDataEng(i,i,i);
einkDataAc(i,i,4,1);
i++;
if(i>10){i=0;}
}
void einkDataEng(uint8_t r, uint8_t f,uint8_t e){upper display part
display.setPartialWindow(0,0,128,128);
r=map(r,0,/*actual data input*/10,0,116); // scale input value to bar length
f=map(f,0,/*actual data input*/10,0,116);
e=map(e,0,/*actual data input*/10,0,116);
do{
display.fillRect(6, 21, 116, 15, GxEPD_WHITE);
display.fillRect(6, 21, r, 15, GxEPD_BLACK);
display.fillRect(6, 61, 116, 15, GxEPD_WHITE);
display.fillRect(6, 61, f, 15, GxEPD_BLACK);
display.fillRect(6, 101, 116, 15, GxEPD_WHITE);
display.fillRect(6, 101, e, 15, GxEPD_BLACK);
} while (display.nextPage());
Serial.println("ENG DATA SHOWN");
}
void einkDataAc( uint8_t t, uint8_t s, uint8_t d , uint8_t ac){ lower display part
display.setPartialWindow(0,136,128,160);
t=map(t,0,/*actual data input*/10,0,125); // scale input value to bar length
s=map(s,0,/*actual data input*/10,0,125);
do{
switch(d){
display.fillRect(7, 212, 114, 37, GxEPD_WHITE);
case 0:
display.drawBitmap(10, 215 ,front_on, 35, 35, GxEPD_BLACK);
display.drawBitmap(48, 215 ,down_off, 35, 35, GxEPD_BLACK);
display.drawBitmap(86, 215 ,up_off, 35, 35, GxEPD_BLACK);
break;
case 1:
display.drawBitmap(10, 215 ,front_on, 35, 35, GxEPD_BLACK);
display.drawBitmap(48, 215 ,down_on, 35, 35, GxEPD_BLACK);
display.drawBitmap(86, 215 ,up_off, 35, 35, GxEPD_BLACK);
break;
case 2:
display.drawBitmap(10, 215 ,front_off, 35, 35, GxEPD_BLACK);
display.drawBitmap(48, 215 ,down_on, 35, 35, GxEPD_BLACK);
display.drawBitmap(86, 215 ,up_off, 35, 35, GxEPD_BLACK);
break;
case 3:
display.drawBitmap(10, 215 ,front_off, 35, 35, GxEPD_BLACK);
display.drawBitmap(48, 215 ,down_on, 35, 35, GxEPD_BLACK);
display.drawBitmap(86, 215 ,up_on, 35, 35, GxEPD_BLACK);
break;
case 4:
display.drawBitmap(10, 215 ,front_off, 35, 35, GxEPD_BLACK);
display.drawBitmap(48, 215 ,down_off, 35, 35, GxEPD_BLACK);
display.drawBitmap(86, 215 ,up_on, 35, 35, GxEPD_BLACK);
break;
}
switch(ac){
display.fillRect(0, 256, 128, 40, GxEPD_WHITE);
case 0:
display.drawBitmap(15, 256,ac_off, 40, 40, GxEPD_BLACK);
display.drawBitmap(72, 256,ac_off, 40, 40, GxEPD_BLACK);
break;
case 1:
display.drawBitmap(15, 256,ac_on, 40, 40, GxEPD_BLACK);
display.drawBitmap(72, 256,ac_off, 40, 40, GxEPD_BLACK);
break;
case 2:
display.drawBitmap(15, 256,ac_on, 40, 40, GxEPD_BLACK);
display.drawBitmap(72, 256,ac_on, 40, 40, GxEPD_BLACK);
break;
}
display.fillRect(1, 141, 125, 15, GxEPD_WHITE);
display.fillRect(1, 141, t, 15, GxEPD_BLACK);
display.fillRect(6, 178, 125, 15, GxEPD_WHITE);
display.fillRect(1, 178, s, 15, GxEPD_BLACK);
} while (display.nextPage());
Serial.println("A/C DATA SHOWN");
}