Open svishnu06 opened 7 years ago
You are printing left-aligned. This means that if you go from 3 to 2 digits (100 to 99) the last digit (0) remains on the display. Same happens when counting from 10 to 1. To resolve you could clear the counter area before updating or using formatting to always print 3 digits.
I am just a student .. here is my testing code .. (output is here -https://youtu.be/mer0_pwQtsE)..
how to solve it, help me ?
Ucglib_ILI9341_18x240x320_HWSPI ucg(/cd=/ PA2 , /cs=/ PA0, /reset=/ PA1);
int counter = 120;
void setup() { Serial.begin(115200); delay(1000); ucg.begin(UCG_FONT_MODE_TRANSPARENT); ucg.clearScreen(); }
void loop() { counter--;
ucg.setRotate270(); ucg.setFontMode(UCG_FONT_MODE_SOLID); ucg.setFont(ucg_font_inb33_mn); ucg.setColor(255, 255, 255); ucg.setPrintPos(45, 200); ucg.println( counter);
delay(200);
}
Depends on what you want to achieve there are multiple solutions:
Give it a try, start experimenting.
Add a space If the number is less then 99
Jim Miller 269-923-6231 office 269-208-8391 cell
On Feb 20, 2017, at 2:01 PM, svishnu06 notifications@github.com wrote:
I am just a student .. here is my testing code .. (output is here -https://youtu.be/mer0_pwQtsE)..
how to solve it, help me ?
include
include
Ucglib_ILI9341_18x240x320_HWSPI ucg(/cd=/ PA2 , /cs=/ PA0, /reset=/ PA1);
int counter = 120;
void setup() { Serial.begin(115200); delay(1000); ucg.begin(UCG_FONT_MODE_TRANSPARENT); ucg.clearScreen(); }
void loop() { counter--;
ucg.setRotate270(); ucg.setFontMode(UCG_FONT_MODE_SOLID); ucg.setFont(ucg_font_inb33_mn); ucg.setColor(255, 255, 255); ucg.setPrintPos(45, 200); ucg.println( counter);
delay(200);
}
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
i am testing with stm32f103c8t6 and ili9341 combination, problem is when trying to display a counter (numbers) , for example - to display countdown number 110 to 1 , after "100" display shows "990" , not "99" ,last zero is still there. after "10" , "90" not '9'.. at last "100" instead of '1', then ''000'' for '0' , how to solve this problem ? a video link.. https://youtu.be/mer0_pwQtsE help me to solve this .