-
Notifications
You must be signed in to change notification settings - Fork 865
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
Fix SSD1306 example to display all text on small (32px) screens #527
base: develop
Are you sure you want to change the base?
Conversation
accidentally closed the pr by deleting my local branch, re-opening |
Also, can you change the base branch to |
e0d8b62
to
5932b77
Compare
// Height limit reached. Show some lines. | ||
if (y == SSD1306_HEIGHT) { | ||
render(buf, &frame_area); | ||
sleep_ms(3000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what happens when you run this app is:
- Lines 0 to 3 get printed ("a long time ago on an oled display far far away")
- Wait 3s (this the sleep on 398)
- Lines 4 to 7 get printed ("live a small red raspberry by the name of PICO")
- Wait 3s (again the sleep on 398)
- The extra check on lines 404 to 407 doesn't run with the default text because y is reset to 0
- Wait another 3s (this is the extra sleep on line 409 we should remove)
Leaving the sleep on line 398 and 406 ensures that text always displays for exactly 3s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good!
I don't have a SSD1306 with which to test, but the code looks fairly plausible. Thanks for incorporating all my feedback @kaycebasques ! |
The last 4 lines of
text
are never displayed on the 32px-tall versions of SSD1306. This PR makes sure all oftext
is always displayed (at the cost of making the logic a bit more complex).