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
GPIO.output(d2,0) |
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
#Function to play sounds | |
def play_sound(x): | |
pygame.mixer.music.load(x) | |
pygame.mixer.music.play(1) | |
while pygame.mixer.get_busy() == True: | |
continue |
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
#Function to roll dice | |
def dice(): | |
roll = randint(1,6) | |
print(roll) | |
if roll == 1: | |
GPIO.output(d1,1) | |
sleep(3) | |
GPIO.output(d1,0) | |
elif roll == 2: | |
GPIO.output(d1,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
while True: | |
if GPIO.input(r13) == True: | |
print("button pressed") | |
sleep(0.5) | |
play_sound(ladder) | |
elif GPIO.input(r39) == True: | |
print("button pressed") | |
sleep(0.5) | |
play_sound(ladder) | |
elif GPIO.input(r67) == True: |
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 testme.py |
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 raspi-config |
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 ws2812 | |
from time import sleep | |
from random import randint | |
ws2812.init(64) | |
""" | |
while True: | |
for i in range(0,64): | |
ws2812.setPixelColor(i,128,64,64) | |
ws2812.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
Hello | |
Right, well the goal as I see it is to create a master card that contains all the packages that you need? | |
if that is the case, create a card on a Pi, that has all the programs that you want. | |
Using software such as dd or win32disk imager create a cloned image of that card. | |
Using the same software copy that image to each of the cards that you wish to use. |
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 Modules | |
import time | |
import datetime | |
import RPi.GPIO as GPIO | |
import pygame | |
import picamera | |
from random import choice |
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
#Setup Pygame | |
pygame.init() | |
pygame.mixer.init() |