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
<style> | |
h1 { | |
text-shadow: 2px 2px #FF0000; | |
} | |
</style> |
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 #GPIO Libraries | |
from time import sleep #Sleep Functions | |
import readchar | |
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) |
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 #GPIO Libraries | |
from time import sleep #Sleep Functions | |
import readchar | |
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
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 | |
from time import sleep | |
GPIO.setmode(GPIO.BOARD) | |
GPIO.setup(13, GPIO.OUT) | |
GPIO.setup(15, GPIO.OUT) | |
def forward(x): | |
GPIO.output(13, GPIO.HIGH) | |
sleep(x) |
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 | |
GPIO.setmode(GPIO.BCM) #tells the program what labeling system to use. Use BCM. | |
GPIO.setup(23, GPIO.OUT) #tells the pi exactly what number pin you'll be using eg. 23 | |
#the code | |
GPIO.output(23, GPIO.HIGH) #tells the pi to turn on this pin eg.23 turns on | |
sleep(1) | |
GPIO.output(23, GPIO.LOW) #tells the pi to turn off this pin eg.23 turns off |
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
#For testing if a rover's motors are working. | |
#Runs each pair of motors forwards for 2 seconds, then backwards for 2 seonds. | |
#Full test tests about 14 seconds to cycle through. | |
#Godspeed. | |
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 |
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 #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 | |
GPIO.setup(23, GPIO.OUT) #tells the pi exactly what number pin you'll be using | |
GPIO.setup(24, GPIO.OUT) | |
GPIO.setup(17, GPIO.OUT) | |
GPIO.setup(27, 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
#BETA | |
def usdconversion(): | |
usdmoney=(int(input("Please enter the amount of EURO you would like to convert to USD"))) | |
usdconverter = 1.10 | |
usdthing = 1/usdconverter | |
usdmoney = usdmoney*usdconverter | |
print(usdmoney) | |
def gbpconversion(): | |
gbpmoney=(int(input("Please enter the amount of EURO you would like to convert to GBP"))) |
NewerOlder