Skip to content

Instantly share code, notes, and snippets.

@dulichan
Created July 18, 2014 03:31
Show Gist options
  • Save dulichan/65164276cfca48e236ed to your computer and use it in GitHub Desktop.
Save dulichan/65164276cfca48e236ed to your computer and use it in GitHub Desktop.
Actuator code in the Raspberry Pi (stripped down version)
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