I/O: Move GPIO examples away from I2C pins

It appears as if using the I2C pins for GPIO requires a restart of the Raspberry Pi before the I2C interface can be used again. Play safe and move the examples to pins that aren't used for anything else.
This commit is contained in:
gohai
2015-10-12 17:00:49 +02:00
parent 3ddf2d773c
commit 06799bb757
3 changed files with 19 additions and 19 deletions
@@ -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);