User Manual
66
GPIO.output(relayPin, GPIO.LOW) # Set the pins of transistor as low level to actuate
the relay.
time.sleep(1) # wait for 1 second. Change the switching frequency of the relay by
changing this parameter. Note: Relay is a kind of metal dome formed in mechanical
structure. So its lifespan will be shortened under high-frequency using.
GPIO.output(relayPin, GPIO.HIGH) # Set the pins of the transistor as low level to
let the relay open.
time.sleep(1)
Now, connect a dev ice of high v oltage, and the relay will close and the LED will light up;
connect one of low voltage, and it will open and the LED will go out. In addition, you can
hear a ticktock caused by breaking normally close contact and closing normally open
contact.
SunFounder