Skip to content

Commit

Permalink
turn off LEDs and hexpansions on power off
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDick authored and thinkl33t committed Feb 28, 2025
1 parent c125076 commit 526503c
Showing 1 changed file with 15 additions and 0 deletions.
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

0 comments on commit 526503c

Please # to comment.