Relay

javadoc

Just set controller pin to switchOn/Off a relay like this one ...

 

[Todo : check if other controller can be used, like I2C things]

TODO : make PinControl interface - and make relay.attach(pincontrol)

Examples:


#file : service/Relay.py edit raw
#########################################
# Relay.py
# description: Relay used by an arduino
# categories: home automation
# more info @: http://myrobotlab.org/service/Relay
#########################################

# start the service

relay = Runtime.start('relay','Relay')

arduino = Runtime.start("arduino","Arduino")
arduino.connect("COM3")

relay.arduino=arduino
relay.pin=8
relay.onValue=0

relay.on()
sleep(2)
relay.off()