]> Zhao Yanbai Git Server - acecode.git/commitdiff
...
authoracevest <zhaoyanbai@126.com>
Sat, 10 Jan 2015 14:24:07 +0000 (22:24 +0800)
committeracevest <zhaoyanbai@126.com>
Sat, 10 Jan 2015 14:24:07 +0000 (22:24 +0800)
RaspberryPi/led.py [new file with mode: 0755]

diff --git a/RaspberryPi/led.py b/RaspberryPi/led.py
new file mode 100755 (executable)
index 0000000..c036e64
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# ------------------------------------------------------------------------
+#   File Name: led.py
+#      Author: Zhao Yanbai
+#              Sat Jan 10 21:53:49 2015
+# Description: none
+# ------------------------------------------------------------------------
+import RPi.GPIO as GPIO
+import time
+
+GPIO.setmode(GPIO.BOARD)
+GPIO.setup(7, GPIO.OUT)
+
+times = 0
+while True :
+    if times % 2 == 0 :
+        GPIO.output(7, GPIO.HIGH)
+    else :
+        GPIO.output(7, GPIO.LOW)
+    time.sleep(1)
+    times += 1