Last active
September 24, 2015 20:55
-
-
Save bennuttall/caf95eff21436acae512 to your computer and use it in GitHub Desktop.
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
# instead of... | |
import RPi.GPIO as GPIO | |
from time import sleep | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setwarnings(False) | |
led = 2 | |
GPIO.setup(led, GPIO.OUT) | |
while True: | |
GPIO.output(led, True) | |
sleep(1) | |
GPIO.output(led, False) | |
sleep(1) | |
# code would look like this: | |
from gpiozero import LED | |
from time import sleep | |
red = LED(2) | |
while True: | |
red.on() | |
sleep(1) | |
red.off() | |
sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment