Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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