Product User’s Manual -
HAT-MAKER
elif
SW2.is_pressed
and
SW3.is_pressed:
sleep(0.5)
for
loop
in
range
(times):
BUZZER.on()
led(ALL_ON)
sleep(0.2)
BUZZER.off()
led(ALL_OFF)
sleep(0.2)
sleep(0.5)
os.system(“sudo shutdown -h now”)
elif
SW2.is_pressed
and
mode != INCREASE:
beep(2, 0.07)
mode = INCREASE
elif
SW3.is_pressed
and
mode != NONE:
beep(1, 0.07)
mode = NONE
if
mode == INCREASE:
if
ledPosition < 8:
ledPosition = ledPo 1
else
:
ledPosition = 0
elif
mode == DECREASE:
if
ledPosition > 0:
ledPosition = ledPosition - 1
else
:
ledPosition = 8
led(ledPosition)
sleep(0.05)
except
KeyboardInterrupt
:
led(ALL_OFF)
Created by
Cytron Technologies Sdn Bhd
– All Rights Reserved
Back to