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 gpiozero import LED | |
from signal import pause | |
green = LED(2) | |
yellow = LED(3) | |
green.blink() | |
yellow.blink() | |
pause() |
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 twython import Twython, TwythonError | |
from blinkt import set_pixel, show | |
import blinkt | |
import time | |
import urllib2 | |
APP_KEY = '' #Enter your twitter information here | |
APP_SECRET = '' | |
ACCESS_TOKEN= '' |
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
def check_answer(expected): | |
while True: | |
if sensor.touch_status_changed(): | |
sensor.update_touch_data() | |
if sensor.is_new_touch(expected): | |
if expected !=99: | |
print ("Correct") | |
state = True | |
return state | |
break |
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
#################################################################################### | |
#This quiz is based on sample Bare conductive code - see licence information below# | |
#################################################################################### | |
# # | |
# Bare Conductive Pi Cap # | |
# ---------------------- # | |
# # | |
# simple-touch.py - simple MPR121 touch detection demo with stdout output # | |
# # | |
# Written for Raspberry Pi. # |
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 mcpi.minecraft as minecraft | |
import mcpi.block as block | |
import random | |
import math | |
mc=minecraft.Minecraft.create() | |
safe = False |
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 random import * | |
particles = [] | |
total = 100000 | |
while (total > 1) : | |
for i in range (total): | |
face = randint(1,6) | |
particles.append(face) | |
for items in particles: | |
if items == 6: |
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
#!/usr/bin/env python | |
from random import randint | |
particles = [] ## create an empty list | |
results = [] ## create a blank list | |
max_count = 100 ## start with this number of cubes | |
while (max_count > 1) : | |
for i in range (max_count): ## populate array with random dice throws |
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 random import randint | |
particles = [] ## create an empty list | |
results = [] ## create a blank list for the results | |
max_count = 100 ## start with this number of cubes | |
x_series = [] | |
while (max_count > 1) : | |
for i in range (max_count): ## populate array with random dice throws |
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
## Gingerbread house by Spencer Organ | |
import mcpi.minecraft as minecraft | |
import mcpi.block as block | |
mc=minecraft.Minecraft.create() | |
x,y,z=mc.player.getPos() | |
x+=2 | |
mc.setBlocks(x,y,z,x+6,y+3,z+6,block.WOOL.id,12) | |
mc.setBlocks(x+1,y-1,z+1,x+5,y+2,z+5,block.AIR) | |
mc.setBlocks(x+1,y-1,z+1,x+5,y-1,z+5,block.WOOL.id,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
#!/usr/bin/env python3 | |
import flotilla | |
import time | |
client = flotilla.Client( | |
requires={ | |
'seven':flotilla.Matrix, | |
'two':flotilla.Number, | |
'one':flotilla.Weather, |