Commit db29311c authored by matteo perini's avatar matteo perini

esempi servo e led

parent 5cb86003
from gpiozero import LED
from time import sleep
led = LED(27)
led = LED("BOARD40")
led2 = LED(19)
while True:
led.on()
led2.off()
sleep(1)
led.off()
led.off()#accendo il primo led
led2.on()
sleep(1)
import RPi.GPIO as GPIO
from mfrc522 import SimpleMFRC522
from gpiozero import LED
attiva = LED(5)
disattiva = LED(6)
def identificati():
try:
reader = SimpleMFRC522()
print("Ciao, avvicina il tag RFID al ricevitore!")
id,text = reader.read()
print(id)
#print(text)
except:
pass
finally:
GPIO.cleanup()
return str(id)
a= True
while a:
attiva.off()
disattiva.on()
codice = identificati()
if codice == "357675773210":
print("suona")
a = False
from gpiozero import Servo
from time import sleep
s = Servo(4)
while True:
s.min()
sleep(2)
s.mid()
sleep(2)
s.max()
sleep(2)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment