From 2b7894202a5a32bb3765139ed9ba5ef7d16f4b32 Mon Sep 17 00:00:00 2001 From: acevest Date: Sat, 10 Jan 2015 22:24:07 +0800 Subject: [PATCH] ... --- RaspberryPi/led.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 RaspberryPi/led.py 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 -- 2.44.0