Last active
July 2, 2022 03:53
-
-
Save teuteuguy/c59337cc6a501607826be22b7d9b4717 to your computer and use it in GitHub Desktop.
Revisions
-
teuteuguy revised this gist
Jul 2, 2022 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,9 @@ # launcher.sh # navigate to home directory, then to this directory, then execute python script, then back home # Add the following to the crontab (crontab -e) for run at startup # @reboot sh /home/pi/Downloads/launcher.sh >/home/pi/logs/cronlog 2>&1 cd / cd home/pi/Downloads sudo python hello.py -
teuteuguy revised this gist
Jul 2, 2022 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,7 @@ #!/bin/sh # launcher.sh # navigate to home directory, then to this directory, then execute python script, then back home cd / cd home/pi/Downloads sudo python hello.py -
teuteuguy revised this gist
Jul 2, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ -
teuteuguy revised this gist
Jul 2, 2022 . 1 changed file with 137 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,137 @@ from sense_hat import SenseHat import time sense = SenseHat() sense.set_rotation(270) def empty_col(col): sense.set_pixel(col, 0, (0, 0, 0)) sense.set_pixel(col, 1, (0, 0, 0)) sense.set_pixel(col, 2, (0, 0, 0)) sense.set_pixel(col, 3, (0, 0, 0)) sense.set_pixel(col, 4, (0, 0, 0)) sense.set_pixel(col, 5, (0, 0, 0)) sense.set_pixel(col, 6, (0, 0, 0)) sense.set_pixel(col, 7, (0, 0, 0)) def empty_line(line): sense.set_pixel(0, line, (0, 0, 0)) sense.set_pixel(1, line, (0, 0, 0)) sense.set_pixel(2, line, (0, 0, 0)) sense.set_pixel(3, line, (0, 0, 0)) sense.set_pixel(4, line, (0, 0, 0)) sense.set_pixel(5, line, (0, 0, 0)) sense.set_pixel(6, line, (0, 0, 0)) sense.set_pixel(7, line, (0, 0, 0)) def full(): # line 0 sense.set_pixel(0, 0, (0, 0, 0)) sense.set_pixel(1, 0, (0, 0, 0)) sense.set_pixel(2, 0, (0, 0, 0)) sense.set_pixel(3, 0, (255, 255, 255)) sense.set_pixel(4, 0, (255, 255, 255)) sense.set_pixel(5, 0, (0, 0, 0)) sense.set_pixel(6, 0, (0, 0, 0)) sense.set_pixel(7, 0, (0, 0, 0)) # line 1 sense.set_pixel(0, 1, (0, 0, 0)) sense.set_pixel(1, 1, (0, 0, 0)) sense.set_pixel(2, 1, (255, 255, 255)) sense.set_pixel(3, 1, (255, 255, 255)) sense.set_pixel(4, 1, (255, 255, 255)) sense.set_pixel(5, 1, (255, 255, 255)) sense.set_pixel(6, 1, (0, 0, 0)) sense.set_pixel(7, 1, (0, 0, 0)) # line 2 sense.set_pixel(0, 2, (0, 0, 0)) sense.set_pixel(1, 2, (255, 255, 255)) sense.set_pixel(2, 2, (255, 255, 255)) sense.set_pixel(3, 2, (255, 255, 255)) sense.set_pixel(4, 2, (255, 255, 255)) sense.set_pixel(5, 2, (255, 255, 255)) sense.set_pixel(6, 2, (255, 255, 255)) sense.set_pixel(7, 2, (0, 0, 0)) # line 3 sense.set_pixel(0, 3, (255, 255, 255)) sense.set_pixel(1, 3, (255, 255, 255)) sense.set_pixel(2, 3, (255, 255, 255)) sense.set_pixel(3, 3, (0, 0, 0)) sense.set_pixel(4, 3, (0, 0, 0)) sense.set_pixel(5, 3, (255, 255, 255)) sense.set_pixel(6, 3, (255, 255, 255)) sense.set_pixel(7, 3, (255, 255, 255)) # line 4 sense.set_pixel(0, 4, (255, 255, 255)) sense.set_pixel(1, 4, (255, 255, 255)) sense.set_pixel(2, 4, (255, 255, 255)) sense.set_pixel(3, 4, (0, 0, 0)) sense.set_pixel(4, 4, (0, 0, 0)) sense.set_pixel(5, 4, (255, 255, 255)) sense.set_pixel(6, 4, (255, 255, 255)) sense.set_pixel(7, 4, (255, 255, 255)) # line 5 sense.set_pixel(0, 5, (0, 0, 0)) sense.set_pixel(1, 5, (255, 255, 255)) sense.set_pixel(2, 5, (255, 255, 255)) sense.set_pixel(3, 5, (255, 255, 255)) sense.set_pixel(4, 5, (255, 255, 255)) sense.set_pixel(5, 5, (255, 255, 255)) sense.set_pixel(6, 5, (255, 255, 255)) sense.set_pixel(7, 5, (0, 0, 0)) # line 6 sense.set_pixel(0, 6, (0, 0, 0)) sense.set_pixel(1, 6, (0, 0, 0)) sense.set_pixel(2, 6, (255, 255, 255)) sense.set_pixel(3, 6, (255, 255, 255)) sense.set_pixel(4, 6, (255, 255, 255)) sense.set_pixel(5, 6, (255, 255, 255)) sense.set_pixel(6, 6, (0, 0, 0)) sense.set_pixel(7, 6, (0, 0, 0)) # line 7 sense.set_pixel(0, 7, (0, 0, 0)) sense.set_pixel(1, 7, (0, 0, 0)) sense.set_pixel(2, 7, (0, 0, 0)) sense.set_pixel(3, 7, (255, 255, 255)) sense.set_pixel(4, 7, (255, 255, 255)) sense.set_pixel(5, 7, (0, 0, 0)) sense.set_pixel(6, 7, (0, 0, 0)) sense.set_pixel(7, 7, (0, 0, 0)) def half(): full() empty_line(0) empty_line(1) empty_line(6) empty_line(7) def closed(): empty_line(0) empty_line(1) empty_line(2) empty_line(3) sense.set_pixel(0, 4, (255, 255, 255)) sense.set_pixel(1, 4, (255, 255, 255)) sense.set_pixel(2, 4, (255, 255, 255)) sense.set_pixel(3, 4, (255, 255, 255)) sense.set_pixel(4, 4, (255, 255, 255)) sense.set_pixel(5, 4, (255, 255, 255)) sense.set_pixel(6, 4, (255, 255, 255)) sense.set_pixel(7, 4, (255, 255, 255)) empty_line(5) empty_line(6) empty_line(7) sense.clear() try: while True: sense.clear() full() time.sleep(4) half() time.sleep(0.02) closed() time.sleep(0.1) except KeyboardInterrupt: pass -
teuteuguy created this gist
Jul 2, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@