Foto resistencia Actualizada en Software
Foto resistencia Actualizada en Software #Librerias from turtle import* import turtle from time import sleep import RPi.GPIO as GPIO import time bg = "pics/room.gif" GPIO.setmode(GPIO.BOARD) #turtle Setup t = Turtle() turtle.setup(960,574) screen = t.getscreen() screen.title("Semaforo Sincronizado") screen.bgpic(bg) #Fondo de la ventana colors = ["FFFFEF","FEFFCB","FCFF7D","FAFF4E","F7FF17"] t.speed(0) t.penup() t.ht() #define the pin that goes to the circuit pin_to_circuit = 7 def rc_time (pin_to_circuit): count = 0 #Output on the pin for GPIO.setup(pin_to_circuit, GPIO.OUT) GPIO.output(pin_to_circuit, GPIO.LOW) time.sleep(0.1) #Change the pin back to input GPIO.setup(pin_to_circuit, GPIO.IN) #Count until the pin goes high while (GPIO.input(pin_to_circuit) == GPIO.LOW): ...