Repository navigation
feat(inkplate13spectra): match the examples to the Inkplate 13 manual - #57
Merged
Merged
Conversation
The Inkplate 13 manual teaches sixteen tasks, and its MicroPython solutions are the scripts a reader is told to run. The examples under inkplate13spectra were written separately and differed in structure, in text size and in what they draw, so following a task meant opening a different script. Take the manual's scripts as they are: - New: coordinate_grid.py, scrolling_text.py, bouncing_ball.py, timer_deep_sleep.py, wakeup_button.py, microsd_read_write.py, weather.py, ntp_clock.py and symbols.py, the battery picture that battery_read.py imports. - Updated: hello_world.py, drawing_graphics.py, custom_font.py, battery_read.py, rtc.py, display_image_sd.py and display_image_web.py. - text_colors.py is renamed full_screen_colors.py and now draws the six colours as full-screen bars, as T3 does. - partial_update.py stays as it was, because the Advanced manual keeps it. displayimagesd also ships cosmic-cliffs.jpg (1600 x 1200, public domain), the picture the manual's T13 copies to the card. The web picture example needs a second fix. draw_jpg_from_web in the palette mixin, used by the Inkplate 13SPECTRA and 7SPECTRA, read the whole response with response.content. On a 1600 x 1200 JPG over HTTPS that single read waits for the full file and fails with ETIMEDOUT, so the picture never reached the decoder. Read the body in 4 KB chunks instead, the same change the grayscale mixin got for the Inkplate 10. Checked on an Inkplate 13SPECTRA: the picture from the example downloads in 4.8 s and draws.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Inkplate 13 manual teaches sixteen tasks, and its MicroPython solutions
are the scripts a reader is told to run. The examples under inkplate13spectra
were written separately and differed in structure, in text size and in what
they draw, so following a task meant opening a different script.
Take the manual's scripts as they are:
timer_deep_sleep.py, wakeup_button.py, microsd_read_write.py, weather.py,
ntp_clock.py and symbols.py, the battery picture that battery_read.py imports.
battery_read.py, rtc.py, display_image_sd.py and display_image_web.py.
as full-screen bars, as T3 does.
displayimagesd also ships cosmic-cliffs.jpg (1600 x 1200, public domain), the
picture the manual's T13 copies to the card.
The web picture example needs a second fix. draw_jpg_from_web in the palette
mixin, used by the Inkplate 13SPECTRA and 7SPECTRA, read the whole response
with response.content. On a 1600 x 1200 JPG over HTTPS that single read waits
for the full file and fails with ETIMEDOUT, so the picture never reached the
decoder. Read the body in 4 KB chunks instead, the same change the grayscale
mixin got for the Inkplate 10. Checked on an Inkplate 13SPECTRA: the picture
from the example downloads in 4.8 s and draws.