Hallo everybody, I'm a newbie but actually I managed to do my simple projects with arduino. Now I'm moving into a car display and I'm getting some problems. Let me show.
hardware:
Arduino UNO
Digole OLED 128x64 serial display using UART
https://www.digole.com/images/file/Tech_Data/Digole_Serial_Display_Adapter-Manual.pdf Display manual
My testing loop:
void loop() {
for (int i = 1; i < 8000; i++) {
mydisp.clearScreen();
mydisp.setPrintPos(5,0);
mydisp.print(i*50);
mydisp.setPrintPos(5,1);
mydisp.print(i);
//LEDS
if (i >= 150){
digitalWrite(yellowLed, HIGH);
digitalWrite(redLed, HIGH);
}
else if (i >= 140 && i < 150){
digitalWrite(yellowLed, HIGH);
digitalWrite(redLed, LOW);
}
else {
digitalWrite(yellowLed, LOW);
digitalWrite(redLed, LOW);
}
delay(100);
i = i%160;
}
}
I made for loop "simulating" numbers growing that will be replaced with RPM and KMH... forget about the leds they work well. I'm getting the numbers in the correct position but with actual code the display flickers in a really bad way. The problem is made by clearScreen() method so I should not use it. If I comment it out the stuff works well when going up but got some position issues when the numbers lower and becames form 3 chars to 2, from 2 to 1. I think it's because not clearing the screen I Just overwrite it so where there is no overwriting last number remains.
I also do like to align the text on right side while now they're aligned left.
I hope there is a workaround.
Thank you!