-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to clear certain lines/values without oled.clear()? #63
Comments
Most likely the number of pixels to show the time is changing, resulting in pixels on the right not being overwritten? If you know the maximum number of columns of pixels you need to clear, and it is a 1 page high font, you can call oled.fillLength(length); Each of these leave the cursor on the same line, so you are wanting to print more text on the next line you would need to call println() or setCursor(). |
Thank you. I tried oled.clearToEOL(); but there are still old pixels visible. The bicycle wheel is not turning fast, so I need to have the old values on the display before the new turn overwrites them. This is my code at the moment: `// Tachometer ATtiny85 #include <util/atomic.h> const int hallPin = PB4; // Digital pin hall sensor void setup() { oled.begin(128, 64, sizeof(tiny4koled_init_defaults), tiny4koled_init_defaults); // Init display void loop() { int currentHallState = digitalRead(hallPin); if (currentHallState != lastHallState) { // Check if status has been changed
} Sorry, but when I click on code and insert the code, only a part of it appears as code here :( |
I also tried it with an extra function but this is not working either .. `// Tachometer ATtiny85 #include <util/atomic.h> const int hallPin = PB4; // Digital pin hall sensor void setup() { oled.begin(128, 64, sizeof(tiny4koled_init_defaults), tiny4koled_init_defaults); // Init display void loop() { int currentHallState = digitalRead(hallPin); if (currentHallState != lastHallState) { // Check if status has been changed
} void deleteDataDisplay(byte line) { |
Hello,
I would like to do something like this (this is not valid code; just to give you an idea):
void setup():
oled.setCursor(0, 0);
oled.println(„Headline“);
void loop():
oled.setCursor(0, 8);
oled.print(time);
oled.println(„ ms“);
How can I achieve that the headline is always on top without refreshing itself during every loop and only the time values are changing? Normally I would work with oled.clear() but this clears the headline too. In the Adafruit SSD1306 library this is somehow easier, kind of built-in, the values are overwritten but the old pixels aren’t show up.
In the Tiny4k library I see the old pixels when I skip the oled.clear() function.
The text was updated successfully, but these errors were encountered: