2
我已經有了一個GPIO程序蟒蛇..誰能幫助我獲得相當於C或C++程序樹莓PI運行..GPIO編程下樹莓PI
的Python代碼是
import RPi.GPIO as GPIO
import time
# blinking function
def blink(pin):
GPIO.output(pin,GPIO.HIGH)
time.sleep(1)
GPIO.output(pin,GPIO.LOW)
time.sleep(1)
return
# to use Raspberry Pi board pin numbers
GPIO.setmode(GPIO.BOARD)
# set up GPIO output channel
GPIO.setup(11, GPIO.OUT)
# blink GPIO17 50 times
for i in range(0,50):
blink(11)
GPIO.cleanup()
在此先感謝! :)
感謝隊友..乾杯! :) :) – 2013-04-05 09:58:34