Raspberry-LED

De DiouxX's Wiki
Révision datée du 26 novembre 2015 à 13:45 par Ddevleeschauwer (discussion | contributions) (Code)
Aller à : navigation, rechercher
Ce script permet d'allumer et etéindre une LED connecté au GPIO du Raspberry

Schéma


Raspberry-LED.png


Code

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(18,GPIO.OUT)

print "LED on"
GPIO.output(18,GPIO.HIGH)

time.sleep(5)

print "LED off"
GPIO.output(18,GPIO.LOW)