This file contains 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 characters
import time | |
import RPi.GPIO as GPIO | |
GPIO.setmode(GPIO.BCM) | |
LED = 17 | |
GPIO.setup(LED, GPIO.OUT) | |
while True: | |
GPIO.output(LED, True) | |
time.sleep(1) | |
GPIO.output(LED, False) | |
time.sleep(1) |
This file contains 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 characters
sudo python setup.py install |
This file contains 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 characters
cd python |
This file contains 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 characters
git clone https://github.com/jgarff/rpi_ws281x.git | |
cd | |
scons |
This file contains 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 characters
sudo apt-get install build-essential python-dev git scons swig |
This file contains 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 characters
sudo apt-get update |
This file contains 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 characters
from neopixel import * | |
from gpiozero import Button | |
from time import sleep | |
import random | |
green = Button(4) | |
pink = Button(17) | |
yellow = Button(27) | |
blue = Button(22) |
This file contains 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 characters
except KeyboardInterrupt: | |
for i in range(360): | |
strip.setPixelColor(i,Color(0,0,0)) | |
strip.show() |
This file contains 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 characters
if lights == player: | |
print("CORRECT") | |
correct(0.1) | |
for i in range(150): | |
strip.setPixelColor(i,Color(0,0,0)) | |
strip.show() | |
else: | |
print("WRONG ANSWER McFLY") | |
wrong(0.1) | |
for i in range(150): |
This file contains 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 characters
while len(player) <4: | |
sleep(0.3) | |
if green.is_pressed: | |
player.append("green") | |
neo("green",0.1) | |
print(player) | |
elif pink.is_pressed: | |
player.append("pink") | |
neo("pink",0.1) | |
print(player) |