Permalink
Browse files

Added print functions for the first lesson...

  • Loading branch information...
1 parent 31a43f3 commit 9ea786e7afa55baaa52d0598b1c22276fbaff163 @videoman committed Mar 5, 2013
Showing with 15 additions and 1 deletion.
  1. +5 −0 LED_Fun1.py
  2. +10 −1 LED_Fun4-function.py
View
@@ -29,6 +29,11 @@
GPIO.setup(GPIOGreen_PIN, GPIO.OUT)
GPIO.setup(GPIOBlue_PIN, GPIO.OUT)
+# Tell the user we are going to turn the lights on!
+print "Ok, here is where we turn your lights on!"
+print "PINs are assigned as follows:\nRed:",GPIORed_PIN,"\nGreen:",GPIOGreen_PIN,"\nBlue:",GPIOBlue_PIN
+print "\nAll of the lights should be working\nType Ctrl-c to quit out of the program."
+
# Turn all of the lights on
while True:
GPIO.output(GPIORed_PIN, True)
View
@@ -44,7 +44,16 @@ def blink_all_leds(SLEEP_TIME):
GPIO.output(GPIOBlue_PIN, False)
time.sleep(SLEEP_TIME)
+# Set the pins low first time around
+GPIO.output(GPIORed_PIN, False)
+GPIO.output(GPIOGreen_PIN, False)
+GPIO.output(GPIOBlue_PIN, False)
+
+print "Hello!"
+print "What happens when you push the button?"
+
while True:
- if ( GPIO.input(BUTTON1_PIN) == True ):
+ if ( GPIO.input(BUTTON1_PIN) == False ):
+ print "I blink on and off!"
blink_all_leds(1)

0 comments on commit 9ea786e

Please sign in to comment.