Skip to content
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

After display init, settings of 'rotation' are 90 degrees from expected #23

Closed
mousethief opened this issue Jun 5, 2024 · 0 comments · Fixed by #24
Closed

After display init, settings of 'rotation' are 90 degrees from expected #23

mousethief opened this issue Jun 5, 2024 · 0 comments · Fixed by #24

Comments

@mousethief
Copy link

It looks like there is an internal _ROTATION_OFFSET property that only gets applied at init time. Specific hardware is the Adafruit 128x64 OLED FeatherWing.

I have attached example code to illustrate the issue.

import neopixel
import board
import time
import displayio
import adafruit_displayio_sh1107

led_neo_onboard = neopixel.NeoPixel(
	pin = board.NEOPIXEL,
	n = 1,
	brightness = 1,
	)
led_neo_onboard[0] = (0, 0, 0)

bus_i2c = board.I2C()

# Compatibility with both CircuitPython 8.x.x and 9.x.x.
# Remove after 8.x.x is no longer a supported release.
try:
	from i2cdisplaybus import I2CDisplayBus
except ImportError:
	from displayio import I2CDisplay as I2CDisplayBus

time.sleep(1)
led_neo_onboard[0] = (2, 0, 0)
print("Release the hounds! er, displays.")
displayio.release_displays()

time.sleep(1)
led_neo_onboard[0] = (1, 1, 0)
print("Make the bus object")
display_bus = I2CDisplayBus(bus_i2c, device_address=0x3C)

time.sleep(1)
led_neo_onboard[0] = (0, 2, 0)
print("Make the display object")
display_sh1107 = adafruit_displayio_sh1107.SH1107(
	display_bus,
	width = 128,
	height = 64,
	rotation = 0,
	)

time.sleep(1)
led_neo_onboard[0] = (0, 1, 1)
print("Rotate the display to 0 degrees")
display_sh1107.rotation = 0

while True:
	pass


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant