diff --git a/java/libraries/io/examples/Interrupt/Interrupt.pde b/java/libraries/io/examples/Interrupt/Interrupt.pde index ea3433297..9781fb0bc 100644 --- a/java/libraries/io/examples/Interrupt/Interrupt.pde +++ b/java/libraries/io/examples/Interrupt/Interrupt.pde @@ -1,20 +1,20 @@ import processing.io.*; color bgcolor = 0; -// RPI.PIN3 refers to the physical pin 3 on the Raspberry Pi's -// pin header, which is located on the third row, next to a -// Ground pin +// RPI.PIN7 refers to the physical pin 7 on the Raspberry Pi's +// pin header, which is located on the fourth row, above one of +// the Ground pins void setup() { - GPIO.pinMode(RPI.PIN3, GPIO.INPUT); - GPIO.attachInterrupt(RPI.PIN3, this, "pinEvent", GPIO.RISING); + GPIO.pinMode(RPI.PIN7, GPIO.INPUT); + GPIO.attachInterrupt(RPI.PIN7, this, "pinEvent", GPIO.RISING); } void draw() { background(bgcolor); } -// this function will be called whenever pin 3 is brought from LOW to HIGH +// this function will be called whenever pin 7 is brought from LOW to HIGH void pinEvent(int pin) { println("Received interrupt"); if (bgcolor == 0) { diff --git a/java/libraries/io/examples/SimpleInput/SimpleInput.pde b/java/libraries/io/examples/SimpleInput/SimpleInput.pde index 3935f9bf6..be1c78344 100644 --- a/java/libraries/io/examples/SimpleInput/SimpleInput.pde +++ b/java/libraries/io/examples/SimpleInput/SimpleInput.pde @@ -1,18 +1,18 @@ import processing.io.*; -// RPI.PIN3 refers to the physical pin 3 on the Raspberry Pi's -// pin header, which is located on the second row, next to the -// 5v power pin +// RPI.PIN7 refers to the physical pin 7 on the Raspberry Pi's +// pin header, which is located on the fourth row, above one of +// the Ground pins void setup() { - GPIO.pinMode(RPI.PIN3, GPIO.INPUT); + GPIO.pinMode(RPI.PIN7, GPIO.INPUT); // this is equivalent to addressing the pin with its GPIO number: - // GPIO.pinMode(2, GPIO.INPUT); + // GPIO.pinMode(4, GPIO.INPUT); } void draw() { // sense the input pin - if (GPIO.digitalRead(RPI.PIN3) == GPIO.HIGH) { + if (GPIO.digitalRead(RPI.PIN7) == GPIO.HIGH) { fill(255); } else { fill(204); diff --git a/java/libraries/io/examples/SimpleOutput/SimpleOutput.pde b/java/libraries/io/examples/SimpleOutput/SimpleOutput.pde index dfde0ca39..84c22bcdf 100644 --- a/java/libraries/io/examples/SimpleOutput/SimpleOutput.pde +++ b/java/libraries/io/examples/SimpleOutput/SimpleOutput.pde @@ -1,14 +1,14 @@ import processing.io.*; boolean ledOn = false; -// RPI.PIN5 refers to the physical pin 5 on the Raspberry Pi's -// pin header, which is located on the third row, next to a -// Ground pin +// RPI.PIN7 refers to the physical pin 7 on the Raspberry Pi's +// pin header, which is located on the fourth row, above one of +// the Ground pins void setup() { - GPIO.pinMode(RPI.PIN5, GPIO.OUTPUT); + GPIO.pinMode(RPI.PIN7, GPIO.OUTPUT); // this is equivalent to addressing the pin with its GPIO number: - // GPIO.pinMode(3, GPIO.OUTPUT); + // GPIO.pinMode(4, GPIO.OUTPUT); frameRate(0.5); } @@ -16,10 +16,10 @@ void draw() { // make the LED blink ledOn = !ledOn; if (ledOn) { - GPIO.digitalWrite(RPI.PIN5, GPIO.LOW); + GPIO.digitalWrite(RPI.PIN7, GPIO.LOW); fill(204); } else { - GPIO.digitalWrite(RPI.PIN5, GPIO.HIGH); + GPIO.digitalWrite(RPI.PIN7, GPIO.HIGH); fill(255); } stroke(255);