IO: Implement Raspbian-only method for setting pull{up,down} resistors

Aarch64 version compiled courtesy of @xranby
This commit is contained in:
gohai
2018-06-16 11:11:40 -07:00
parent 913d9d8c09
commit d613f999c0
5 changed files with 184 additions and 3 deletions

View File

@@ -5,7 +5,10 @@ import processing.io.*;
// see setup.png in the sketch folder for wiring details
void setup() {
GPIO.pinMode(4, GPIO.INPUT);
// INPUT_PULLUP enables the built-in pull-up resistor for this pin
// left alone, the pin will read as HIGH
// connected to ground (via e.g. a button or switch) it will read LOW
GPIO.pinMode(4, GPIO.INPUT_PULLUP);
}
void draw() {