-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add support for 0.49'' 64 x 32 #31
Merged
Merged
Conversation
This file contains 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
Tested on "OLED 0.49 Shield V1.0.0 for LOLIN (WEMOS) D1 mini D32 0.49" inch 64x32 IIC I2C" Based on the issue adafruit#20 and all the work from @adamcandy on the non DisplayIO library: https://github.com/adafruit/Adafruit_CircuitPython_SSD1306
To simplify testing on those tiny screen.
tannewt
reviewed
Dec 12, 2022
Explain the test for a special resolution. I expected the same formula to work for all board, but at least 32x64 screen have special need.
This was referenced Dec 29, 2022
Tested on Adafruit CircuitPython 8.0.2 on 2023-02-14; Adafruit Feather RP2040 with rp2040 with an Tested both examples in the library and our staple Bouncing ball example. # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
"""
This is an animation to demonstrate the use of Circle Setter Attribute.
"""
import time
import gc
import board
import displayio
from adafruit_display_shapes.circle import Circle
# use built in display (MagTag, PyPortal, PyGamer, PyBadge, CLUE, etc.)
# see guide for setting up external displays (TFT / OLED breakouts, RGB matrices, etc.)
# https://learn.adafruit.com/circuitpython-display-support-using-displayio/display-and-display-bus
display = board.DISPLAY
# Make the display context
main_group = displayio.Group()
# Make a background color fill
color_bitmap = displayio.Bitmap(display.width, display.height, 1)
color_palette = displayio.Palette(1)
color_palette[0] = 0xFFFFFF
bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
main_group.append(bg_sprite)
# Setting up the Circle starting position
posx = 50
posy = 50
# Define Circle characteristics
circle_radius = 20
circle = Circle(posx, posy, circle_radius, fill=0x00FF00, outline=0xFF00FF)
main_group.append(circle)
# Define Circle Animation Steps
delta_x = 2
delta_y = 2
# Showing the items on the screen
display.show(main_group)
while True:
if circle.y + circle_radius >= display.height - circle_radius:
delta_y = -1
if circle.x + circle_radius >= display.width - circle_radius:
delta_x = -1
if circle.x - circle_radius <= 0 - circle_radius:
delta_x = 1
if circle.y - circle_radius <= 0 - circle_radius:
delta_y = 1
circle.x = circle.x + delta_x
circle.y = circle.y + delta_y
time.sleep(0.02)
gc.collect() Works as intended. LGTM |
tannewt
approved these changes
Feb 21, 2023
Thank you! |
adafruit-adabot
added a commit
to adafruit/Adafruit_CircuitPython_Bundle
that referenced
this pull request
Feb 28, 2023
Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306 to 1.6.0 from 1.5.11: > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_SSD1306#31 from dglaude/0.49''-64-x-32 > Add upload url to release action > Add .venv to .gitignore Updating https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731 to 3.3.7 from 3.3.6: > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3731#53 from EAGrahamJr/fade_52 > Add upload url to release action > Add .venv to .gitignore Updating https://github.com/adafruit/Adafruit_CircuitPython_PN532 to 2.3.16 from 2.3.14: > Merge pull request adafruit/Adafruit_CircuitPython_PN532#63 from caternuson/iss44 > Merge pull request adafruit/Adafruit_CircuitPython_PN532#62 from caternuson/iss49 > Add upload url to release action > Add .venv to .gitignore Updating https://github.com/adafruit/Adafruit_CircuitPython_RFM69 to 2.1.14 from 2.1.13: > Merge pull request adafruit/Adafruit_CircuitPython_RFM69#44 from jerryneedell/jerryn_size > Add upload url to release action > Add .venv to .gitignore > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1675 to 1.1.16 from 1.1.15: > Merge pull request adafruit/Adafruit_CircuitPython_SSD1675#14 from jposada202020/updating_example > Add upload url to release action > Add .venv to .gitignore > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1680 to 1.0.14 from 1.0.12: > Merge pull request adafruit/Adafruit_CircuitPython_SSD1680#12 from jposada202020/adding_breakout_example > Merge pull request adafruit/Adafruit_CircuitPython_SSD1680#11 from jposada202020/main > Merge pull request adafruit/Adafruit_CircuitPython_SSD1680#9 from dave-ct/128 > Add upload url to release action > Add .venv to .gitignore > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_Touchscreen to 1.2.0 from 1.1.17: > Merge pull request adafruit/Adafruit_CircuitPython_Touchscreen#23 from rtwfroody/invert > Add upload url to release action > Add .venv to .gitignore > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_AirLift to 1.0.9 from 1.0.8: > Merge pull request adafruit/Adafruit_CircuitPython_AirLift#8 from glenrobertson/patch-1 > Add upload url to release action > Add .venv to .gitignore > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 2.7.0 from 2.6.6: > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#105 from FoamyGuy/multicolor_comet Updating https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal to 3.0.11 from 3.0.10: > Merge pull request adafruit/Adafruit_CircuitPython_MatrixPortal#88 from Lnk2past/master > Add upload url to release action > Add .venv to .gitignore > Update .pylintrc for v2.15.5 > Fix release CI files > Update pylint to 2.15.5 > Updated pylint version to 2.13.0 > Switching to composite actions Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 7.3.1 from 7.3.0: > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#156 from vladak/suback_var_payload > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#153 from vladak/back_off_tests Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA: > Updated download stats for the libraries
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.
Trying to follow all the discussion on #20 and the work of @adamcandy on the non DisplayIO library: https://github.com/adafruit/Adafruit_CircuitPython_SSD1306
Tested on "OLED 0.49 Shield V1.0.0 for LOLIN (WEMOS) D1 mini D32 0.49" inch 64x32 IIC I2C"
I believe this would require more testing on all of the Adafruit 128x display (to avoid regression).
And it could be tested on other small display: Dots 72x40, 64x48 and 96x16.
I am not 100% on the logic, it might fail too when the screen is rotated.
The simpletest is optional, I just feel it help do testing.