I don't understand... I'm trying just a basic code and it doesn't work.
Arduino code :
int value;
void setup(){
Serial.begin(9600);
}
void loop(){
if(Serial.available() > 0){
i++;
value = Serial.read();
Serial.println(value);
delay(500);
}else{
Serial.println("Nothing is detected");
delay(500);
}
}
Processing code :
import processing.serial.*;
Serial myPort;
void setup(){
size (100, 200);
println(Serial.list());
String portName = Serial.list()[2];
myPort = new Serial(this, portName, 9600);
}
void draw(){
for(int i = 0; i < 10; i++){
myPort.write(i);
println(i, " sent");
delay(500);
}
}
In my Arduino console, I obtained this :
1
23
5
678
9
0
Why did the "4" is missing ? And why do I have 2 and 3 stick together and 6, 7 and 8 ?
Thanks for help !