Add ability to toggle color bars on/off
This commit is contained in:
parent
5e72ba0ece
commit
8cdb4dfbf1
1 changed files with 5 additions and 0 deletions
|
|
@ -19,6 +19,9 @@ import adafruit_ticks
|
||||||
import board
|
import board
|
||||||
import displayio
|
import displayio
|
||||||
import esp32_camera
|
import esp32_camera
|
||||||
|
import keypad
|
||||||
|
|
||||||
|
button = keypad.Keys((board.BOOT,), value_when_pressed=False)
|
||||||
|
|
||||||
cam = esp32_camera.Camera(
|
cam = esp32_camera.Camera(
|
||||||
data_pins=board.CAMERA_DATA,
|
data_pins=board.CAMERA_DATA,
|
||||||
|
|
@ -43,6 +46,8 @@ display_bus.send(42, struct.pack(">hh", 0, 239))
|
||||||
display_bus.send(43, struct.pack(">hh", 0, 80+239))
|
display_bus.send(43, struct.pack(">hh", 0, 80+239))
|
||||||
t0 = adafruit_ticks.ticks_ms()
|
t0 = adafruit_ticks.ticks_ms()
|
||||||
while True:
|
while True:
|
||||||
|
if (event := button.events.get()) and event.pressed:
|
||||||
|
cam.colorbar = not cam.colorbar
|
||||||
frame = cam.take(1)
|
frame = cam.take(1)
|
||||||
if isinstance(frame, displayio.Bitmap):
|
if isinstance(frame, displayio.Bitmap):
|
||||||
display_bus.send(44, frame)
|
display_bus.send(44, frame)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue