adafruit / adafruit/Adafruit_CircuitPython_DisplayIO_SH1107
NeoPixel Ring + SH1107 auto_refresh stops working
- Dominant language
- Python
- Stars
- 14
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
Forum [issue](https://forums.adafruit.com/viewtopic.php?t=216504) regarding a small neopixel ring blocking the SH1107 FeatherWing from auto_refreshing.
When the led.show() for the Neopixel is commented out the OLED updates. If led.show() is left in the code the OLED stops updating within a few iterations.
The work around was to manually call display.refresh().
Working code provided. Comment out display.refresh() reproduces issue.
```
+------------------------------------+-------------------------+
| Item | Description |
+------------------------------------+-------------------------+
| Adafruit Feather STM32F405 | WO# P4382C |
| CircuitPython | 9.2.4 |
| Library Bundle | 20250211 |
| Neopixel Ring 12-LED | ADA# 1643 |
| OLED 128x64 FeatherWing | ADA# 4650 |
+------------------------------------+-------------------------+
```

```
import time
import board
import displayio
from i2cdisplaybus import I2CDisplayBus
import adafruit_displayio_sh1107
from adafruit_display_text import label
import terminalio
import neopixel
import random
# Initialize sh1107 featherwing display
#time.sleep(2)
i2c = board.I2C()
WIDTH = 128
HEIGHT = 64
displayio.release_displays()
display_bus = I2CDisplayBus(i2c, device_address=0x3C)
display = adafruit_displayio_sh1107.SH1107(display_bus, width=WIDTH, height=HEIGHT)
splash = displayio.Group()
display.root_group = splash
# Palette
color_bitmap = displayio.Bitmap(128, 164, 1)
color_palette = displayio.Palette(1) # i.e. one color
color_palette[0] = 0xFFFFFF
# Background
bg_sprite = displayio.TileGrid(color_bitmap, pixel_shader=color_palette, x=0, y=0)
splash.append(bg_sprite)
inner_bitmap = displayio.Bitmap(WIDTH, HEIGHT, 1)
inner_palette = displayio.Palette(1)
inner_palette[0] = 0x000000
inner_sprite = displayio.TileGrid(inner_bitmap, pixel_shader=inner_palette, x=0, y=0)
splash.append(inner_sprite)
# Build display line
line_1 = label.Label(terminalio.FONT, text="", scale=1, color=0xFFFFFF)
line_1.anchor_point = (0, 0)
line_1.anchored_position = (0, 3)
splash.append(line_1)
# Initialize NeoPixel ring
leds = neopixel.NeoPixel(board.D12, 12, brightness=0.1, auto_write=False)
i = 0
leds.fill((0, 0, 0))
leds.show()
while True:
i += 1
print(f"Pass {i}")
# sh1107 display
line_1.text = f"Pass {i}"
# Update display manually to avoid blocking
display.refresh()
# neopixel ring update, but only every other loop iteration
if i % 2 == 0:
leds.fill((0, 0, 0))
else:
leds[0] = (255, 0, 0)
leds.show()
# Adjust timing for both display and NeoPixels
time.sleep(0.25)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running the provided CircuitPython example with the SH1107 display and NeoPixel ring, comparing behavior with and without display.refresh(). Investigate the interaction between leds.show() and SH1107 auto_refresh; done means the display continues updating while the NeoPixel ring is refreshed without requiring the manual workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100