From: acevest Date: Sat, 10 Jan 2015 14:24:07 +0000 (+0800) Subject: ... X-Git-Url: http://zhaoyanbai.com/repos/man.rndc.conf.html?a=commitdiff_plain;h=2b7894202a5a32bb3765139ed9ba5ef7d16f4b32;p=acecode.git ... --- diff --git a/RaspberryPi/led.py b/RaspberryPi/led.py new file mode 100755 index 0000000..c036e64 --- /dev/null +++ b/RaspberryPi/led.py @@ -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