Created
July 13, 2014 19:51
-
-
Save bureibusan/289d639cf237ba9a4854 to your computer and use it in GitHub Desktop.
This file contains 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
//=============================== | |
// arduino | |
//=============================== | |
void setup(){ | |
Serial.begin(9600); | |
pinMode(13,INPUT); | |
} | |
void loop(){ | |
int val=digitalRead(13); | |
Serial.println(val); | |
} | |
//=============================== | |
// processing | |
//=============================== | |
import processing.serial.*; | |
Serial port; | |
void setup(){ | |
size(200,200); | |
port = new Serial(this,"COM3",9600); | |
} | |
void draw(){ | |
delay(100); | |
println(receive); | |
} | |
int receive; | |
void serialEvent(){ | |
delay(100); | |
receive = port.read(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment