I am using the audrino version for the clue and I am using an if else condition where I am making the font color go red with a text "low battery" when the input voltage on a particular analog pin goes to 0 and make the font go green with the text "good battery".
During the change of state and after the state of the pin chnages state, I see that clue still holds on the last text and color.
For example, if the analog pin went from low to high, the new screen data shows overlapping green and red text with low and good battery. I am using all the latest library and clue firmware.
is there something that I need to add to clear the old data in the clue code. I am using the arcada_clue_test example to build my code.
Find attached is the image for reference.
Code snippet:
Code: Select all
//D v6
int batt_ref_pin=A6; // D v6-> pin A6 connected to the vesc temp pin
int battery_ref=80; // D v6-> comparing it to less than 0.3V
int low_batt;
low_batt= analogRead(batt_ref_pin);
//Serial.println(low_batt);
//delay(delayTime);
if (low_batt < battery_ref) {
arcada.display->setTextColor(ARCADA_RED);
arcada.display->println("low battery");
} else {
arcada.display->setTextColor(ARCADA_GREEN);
arcada.display->println("Good battery");
}
When I used this above logic in circuitpython it was able to determine and display correctly.
Any help is greatly appreciated.