package haus.pup.karotz;

import com.pi4j.io.gpio.GpioController;
import com.pi4j.io.gpio.GpioPinDigitalInput;
import com.pi4j.io.gpio.GpioPinDigitalOutput;
import com.pi4j.io.gpio.PinState;
import com.pi4j.io.gpio.RaspiPin;
import com.pi4j.io.gpio.PinPullResistance;

public class Ears {
  GpioPinDigitalOutput rEarR = null;
  GpioPinDigitalOutput rEarL = null;
  GpioPinDigitalOutput lEarR = null;
  GpioPinDigitalOutput lEarL = null;

  GpioPinDigitalInput headBtn = null;

  public Ears(GpioController gpio) {
    rEarR = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_01, "MyLED", PinState.LOW);
    rEarL = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_02, "MyLED", PinState.LOW);
    lEarR = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_03, "MyLED", PinState.LOW);
    lEarL = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_04, "MyLED", PinState.LOW);

    headBtn = gpio.provisionDigitalInputPin(RaspiPin.GPIO_07, PinPullResistance.PULL_DOWN);

  }

  // set shutdown state for this pin
  //pin.setShutdownOptions(true, PinState.LOW);
}

@@ -23,48 +23,8 @@
 z;%0A%0A
-import com.pi4j.io.gpio.GpioController;%0A
 impo
@@ -133,98 +133,18 @@
 .io.
-gpio.PinState;%0Aimport com.pi4j.io.gpio.RaspiPin;%0Aimport com.pi4j.io.gpio.PinPullResistance
+i2c.I2CBus
 ;%0A%0Ap
@@ -368,463 +368,21 @@
 ars(
-GpioController gpio) %7B%0A    rEarR = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_01, %22MyLED%22, PinState.LOW);%0A    rEarL = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_02, %22MyLED%22, PinState.LOW);%0A    lEarR = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_03, %22MyLED%22, PinState.LOW);%0A    lEarL = gpio.provisionDigitalOutputPin(RaspiPin.GPIO_04, %22MyLED%22, PinState.LOW);%0A%0A    headBtn = gpio.provisionDigitalInputPin(RaspiPin.GPIO_07, PinPullResistance.PULL_DOWN);
+I2CBus bus) %7B
 %0A%0A  

use i2c controller