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

turn off LEDs and hexpansions on power off #193

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions modules/firmware_apps/poweroff.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ def draw(self, ctx):
if not self.off:
clear_background(ctx)
if self.off:
from egpio import ePin

HEXPANSION_POWER = {
(2, 12),
(2, 13),
(1, 8),
(1, 9),
(1, 10),
(1, 11),
}
for epin in HEXPANSION_POWER:
pin = ePin(epin, ePin.OUT)
pin.on()
pin = ePin((2, 2), ePin.OUT)
pin.off()
ctx.rgb(0, 0, 0).rectangle(-120, -120, 240, 240).fill()
ctx.font_size = 22
ctx.text_align = ctx.CENTER
Expand Down
Loading