Skip to content

Instantly share code, notes, and snippets.

@m2web
Created September 14, 2012 01:28
Show Gist options
  • Save m2web/3719256 to your computer and use it in GitHub Desktop.
Save m2web/3719256 to your computer and use it in GitHub Desktop.
#!!/usr/bin/env python
import RPi.GPIO as GPIO, time
GPIO.setmode(GPIO.BCM)
GREEN_LDE = 18
RED_LED = 23
GPIO.setup(GREEN_LED, GPIO.OUT)
GPIO.setup(RED_LED, GPIO.OUT)
count = 0
while (count < 5):
print "The count is: ", count
GPIO.output(GREEN_LED, True)
GPIO.output(RED_LED, False)
print "Green light!"
time.sleep(1)
GPIO.output(GREEN_LED, False)
GPIO.output(RED_LED, True)
print "Red light!"
time.sleep(1)
count = count + 1
print "We are done now :-)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment