shutdown button trig a cls
This commit is contained in:
parent
2616fde55b
commit
7a22dc6d7f
@ -53,6 +53,10 @@ cd nerves
|
||||
sudo cp /home/pi/nerves/autorun.conf /etc/supervisor/conf.d/
|
||||
sudo supervisorctl reload
|
||||
|
||||
to stop autorun
|
||||
|
||||
sudo supervisorctl stop nerves
|
||||
|
||||
# Based on :
|
||||
|
||||
* https://www.instructables.com/Fiber-Optic-LED-Lamp/
|
||||
|
@ -73,8 +73,10 @@ def runforever():
|
||||
|
||||
import os
|
||||
print('will shutdown...')
|
||||
#sendWSall("/players Cls...")
|
||||
leds.mode = -1
|
||||
leds.cls()
|
||||
#sendWSall("/players Stopping...")
|
||||
os.system("systemctl poweroff")
|
||||
|
||||
sleep(0.005)
|
||||
|
2
leds.py
2
leds.py
@ -29,7 +29,7 @@ pixel_pin = board.D18 #(-> pin 12)
|
||||
# The number of NeoPixels
|
||||
num_pixels = 14
|
||||
|
||||
palette = [(0,0,0),
|
||||
palette = [(255,255,255),
|
||||
(255,0,0),
|
||||
(0,255,0),
|
||||
(0,0,255),
|
||||
|
@ -48,8 +48,6 @@ import leds
|
||||
import buttons
|
||||
import ws
|
||||
|
||||
|
||||
|
||||
# from Adafruit_GPIO import Platform
|
||||
# print("Platform = ", Platform.platform_detect(), Platform.pi_version())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user