Last active
September 18, 2015 18:47
-
-
Save michaelsarduino/92c02addf7f7f6f691cc 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; | |
void setup() { | |
arduino = new Serial(this, Serial.list()[0], 9600); | |
size(500, 500); | |
} | |
void draw() { | |
if(arduino.available() > 0) | |
{ | |
println(arduino.read()); | |
} | |
} | |
void mouseWheel(MouseEvent event) { | |
int i = event.getCount(); | |
if(i == 1) | |
{ | |
arduino.write("1"); | |
} | |
if(i == -1) { | |
arduino.write("0"); | |
} | |
delay(5); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment