mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-30 00:47:17 +02:00
Limit show CO2 index within 4 character number (max = 9999)
This commit is contained in:
@ -1453,6 +1453,10 @@ static void displayShowDashboard(String err) {
|
|||||||
/** Show CO2 value */
|
/** Show CO2 value */
|
||||||
u8g2.setFont(u8g2_font_t0_22b_tf);
|
u8g2.setFont(u8g2_font_t0_22b_tf);
|
||||||
if (co2Ppm > 0) {
|
if (co2Ppm > 0) {
|
||||||
|
int val = 9999;
|
||||||
|
if (co2Ppm < 10000) {
|
||||||
|
val = co2Ppm;
|
||||||
|
}
|
||||||
sprintf(strBuf, "%d", co2Ppm);
|
sprintf(strBuf, "%d", co2Ppm);
|
||||||
} else {
|
} else {
|
||||||
sprintf(strBuf, "%s", "-");
|
sprintf(strBuf, "%s", "-");
|
||||||
|
@ -1656,7 +1656,11 @@ static void displayShowDashboard(String err) {
|
|||||||
/** Show CO2 value */
|
/** Show CO2 value */
|
||||||
u8g2.setFont(u8g2_font_t0_22b_tf);
|
u8g2.setFont(u8g2_font_t0_22b_tf);
|
||||||
if (co2Ppm > 0) {
|
if (co2Ppm > 0) {
|
||||||
sprintf(strBuf, "%d", co2Ppm);
|
int val = 9999;
|
||||||
|
if(co2Ppm < 10000){
|
||||||
|
val = co2Ppm;
|
||||||
|
}
|
||||||
|
sprintf(strBuf, "%d", val);
|
||||||
} else {
|
} else {
|
||||||
sprintf(strBuf, "%s", "-");
|
sprintf(strBuf, "%s", "-");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user