Created
July 18, 2014 03:31
-
-
Save dulichan/65164276cfca48e236ed to your computer and use it in GitHub Desktop.
Actuator code in the Raspberry Pi (stripped down version)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Receiver{ | |
final GpioController gpio; | |
final GpioPinDigitalOutput pin; | |
{ | |
gpio = GpioFactory.getInstance(); | |
pin = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_00, "Relay"); | |
} | |
public void run(String message){ | |
System.out.println("Message received "+message); | |
if(message.equals("ON")){ | |
pin.high(); | |
}else if(message.equals("OFF")){ | |
pin.low(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment