Skip to content

Commit 7a9a1e2

Browse files
authored
Merge pull request #2254 from jepler/esp32-camera
Add ability to toggle color bars on/off
2 parents d6a75d5 + 8cdb4df commit 7a9a1e2

File tree

1 file changed

+5
-0
lines changed
  • CircuitPython_ESP32_Camera/esp32-s3-eye-lcdview

1 file changed

+5
-0
lines changed

CircuitPython_ESP32_Camera/esp32-s3-eye-lcdview/code.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
import board
2020
import displayio
2121
import esp32_camera
22+
import keypad
23+
24+
button = keypad.Keys((board.BOOT,), value_when_pressed=False)
2225

2326
cam = esp32_camera.Camera(
2427
data_pins=board.CAMERA_DATA,
@@ -43,6 +46,8 @@
4346
display_bus.send(43, struct.pack(">hh", 0, 80+239))
4447
t0 = adafruit_ticks.ticks_ms()
4548
while True:
49+
if (event := button.events.get()) and event.pressed:
50+
cam.colorbar = not cam.colorbar
4651
frame = cam.take(1)
4752
if isinstance(frame, displayio.Bitmap):
4853
display_bus.send(44, frame)

0 commit comments

Comments
 (0)