Hello guys !
I'm trying to send data from arduino to processing sketch with the regular BT shield.
I am able to send data from the processing sketch to the TinyDuino but not from the TinyDuino to the computer.
Connect my shield to the PC create 2 COM Ports (In and out). To send data from the computer to the TinyDuino, I use the out port. So to retrieve data from the TinyDuino on the computer, I use the in port.
Here is my code, very simple one and does not work.
PROCESSING :
import processing.serial.*;
import java.lang.String;
Serial myPortRetrieve;
String myString = null;
void setup() {
println(Serial.list());
//IN PORT
myPortRetrieve = new Serial(this, Serial.list()[1], 9600);
myPortRetrieve.bufferUntil(10);
myPortRetrieve.clear();
}
void draw() {
while (myPortRetrieve.available() > 0) {
myString = myPortRetrieve.readStringUntil(10);
}
if (myString != null) {
println(myString);
}
}
ARDUINO :
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println("heelo world !");
delay(1000);
}
Thx !