Created
August 24, 2015 11:00
-
-
Save michaelsarduino/e912742940f76d99a889 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import processing.serial.*; | |
Serial arduino; | |
String auto = "33"; | |
void setup() { | |
arduino = new Serial(this, "COM15", 9600); | |
size(1200, 900); | |
fill(0); | |
rect(100, 100, 100, 200); | |
rect(100, 400, 100, 100); | |
rect(100, 600, 100, 200); | |
rect(400, 400, 200, 100); | |
rect(700, 400, 100, 100); | |
rect(900, 400, 200, 100); | |
fill(255, 0, 0); | |
triangle(150, 150, 100, 225, 200, 225); | |
rect(120, 420, 60, 60); | |
triangle(100, 700, 200, 700, 150, 775); | |
triangle(450, 450, 525, 400, 525, 500); | |
rect(720, 420, 60, 60); | |
triangle(1000, 400, 1000, 500, 1075, 450); | |
} | |
void draw() { | |
} | |
void mousePressed() { | |
if(mouseX > 100 && mouseX < 200 && mouseY > 100 && mouseY <300) | |
{ | |
String auto = "23"; | |
arduino.write(auto); | |
} | |
if(mouseX > 100 && mouseX < 200 && mouseY > 400 && mouseY <500) | |
{ | |
String auto = "13"; | |
arduino.write(auto); | |
} | |
if(mouseX > 100 && mouseX < 200 && mouseY > 600 && mouseY <800) | |
{ | |
String auto = "03"; | |
arduino.write(auto); | |
} | |
if(mouseX > 400 && mouseX < 600 && mouseY > 400 && mouseY <500) | |
{ | |
String auto = "30"; | |
arduino.write(auto); | |
} | |
if(mouseX > 700 && mouseX < 800 && mouseY > 400 && mouseY <500) | |
{ | |
String auto = "31"; | |
arduino.write(auto); | |
} | |
if(mouseX > 900 && mouseX < 1100 && mouseY > 400 && mouseY <500) | |
{ | |
String auto = "32"; | |
arduino.write(auto); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment