grove.grove_relay
¶
- This is the code for
Examples
import time
from grove.grove_relay import GroveRelay
# connect to pin 5(slot D5)
PIN = 5
relay = GroveRelay(PIN)
while True:
relay.on()
time.sleep(1)
relay.off()
time.sleep(1)
Classes¶
GroveRelay
: Class for Grove - Relay
- class grove.grove_relay.GroveRelay(pin)[source]¶
Class for Grove - Relay
- Parameters:
pin (int) – number of digital pin the relay connected.
Inheritance
digraph inheritance7bce8c847c { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "GPIO" [URL="grove.gpio.gpio_rpi.html#grove.gpio.gpio_rpi.GPIO",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "GroveRelay" [URL="#grove.grove_relay.GroveRelay",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Class for Grove - Relay"]; "GPIO" -> "GroveRelay" [arrowsize=0.5,style="setlinewidth(0.5)"]; }