Skip to content

Instantly share code, notes, and snippets.

@ugeugeHigh
Created October 23, 2018 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ugeugeHigh/fa6d4345f6a7435c50ab5d9888b39b7c to your computer and use it in GitHub Desktop.
Save ugeugeHigh/fa6d4345f6a7435c50ab5d9888b39b7c to your computer and use it in GitHub Desktop.
void setup() {
myPort = new Serial(this,"/dev/cu.usbmodem14121", 9600);
}
void draw() {
fill(value);
rect(25, 25, 50, 50);
}
void mousePressed() {
if(value == 0) {
value = 255;
myPort.write(49);
} else {
value = 0;
myPort.write(48);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment