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 time import sleep | |
lesso = ['lesson 1', 'lesson 2', 'lesson 3', 'lesson 4', 'lesson 5', 'lesson 6', 'end task'] | |
def lesson1(): | |
print("Here you will learn the basics") | |
sleep(1) | |
print("print will allow the computer to say stuff") | |
sleep(1) | |
print("Here is an example: print(\"Hello\")") |
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 RPi.GPIO as GPIO | |
from time import sleep | |
import readchar | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setup(3, GPIO.OUT) #reverse | |
GPIO.setup(5, GPIO.OUT) #forward | |
GPIO.setup(8, GPIO.OUT) #left |
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
#the setup | |
#Reminder: Do you have a resistor in series with your LED? If you don't you will kill the LED and damage the RPi. | |
import RPi.GPIO as GPIO #lets you use GPIO | |
from time import sleep #lets you use sleep(2) as a timer for the lights | |
GPIO.setmode(GPIO.BCM) #tells the program what labeling system to use. We'll use BCM | |
#because that's what it used on your blue cobbler on your breadboard. | |
GPIO.setup(17, GPIO.OUT) #tells the pi exactly what GPIO you'll be using |
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
#the setup | |
import RPi.GPIO as GPIO #lets you use GPIO | |
from time import sleep #lets you use sleep(2) as a timer for the lights | |
GPIO.setmode(GPIO.BOARD) #tells the program what labeling system to use | |
GPIO.setup(17, GPIO.OUT) #tells the pi exactly what number pin you'll be using | |
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: | |
import RPi.GPIO as GPIO #GPIO Libraries | |
from time import sleep #Sleep Functions | |
GPIO.setmode(GPIO.BCM) #Setting Up | |
GPIO.setup(23, GPIO.OUT)#Right Motor Forwards | |
GPIO.setup(24, GPIO.OUT)# Backwards | |
GPIO.setup(17, GPIO.OUT)#Left Motor Backwards | |
GPIO.setup(27, GPIO.OUT)# Forwards |
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 RPi.GPIO as GPIO #lets you use GPIO | |
from time import sleep #lets you pause the program | |
GPIO.setmode(GPIO.BOARD) #chooses BOARD instead of BCM | |
GPIO.setup(11, GPIO.OUT) #sets up the motors | |
GPIO.setup(13, GPIO.OUT) | |
GPIO.setup(16, GPIO.OUT) | |
GPIO.setup(18, GPIO.OUT) |
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
#Only in PYTHON2.7 | |
import RPi.GPIO as GPIO #GPIO Libraries | |
from time import sleep #Sleep Functions | |
import readchar #keyboards | |
GPIO.setwarnings(False)#Blocks error warnings | |
GPIO.setmode(GPIO.BCM) #Setting Up | |
GPIO.setup(23, GPIO.OUT) #back right | |
GPIO.setup(24, GPIO.OUT) #front right |
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 RPi.GPIO as GPIO | |
from time import sleep | |
GPIO.cleanup() | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(17, GPIO.IN) |
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 RPi.GPIO as GPIO | |
from time import sleep | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(24, GPIO.OUT) # motors setup | |
GPIO.setup(17, GPIO.OUT) | |
GPIO.setup(27, GPIO.OUT) | |
GPIO.setup(23, GPIO.OUT) |
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 urllib.request import urlopen | |
from xml.dom import minidom | |
import collections | |
# extract the headlines from the feed | |
def extractString(doc): | |
str = "" | |
for node in doc.getElementsByTagName('channel'): | |
for title in node.getElementsByTagName('title'): | |
str = str + title.firstChild.data + "\n" |
OlderNewer