I am trying to make an arduino project with arduino ide and processing ide. I started doing a simple test to see the enviornment where I display the numbers 0,1..9 using arduino ide, but processing ide doesn't read it right for some reason and I can't figure out why, it reads weird numbers from serial like 10, 13, 53 and so on (only these numbers, nothing changes). Here is my processing code:
import processing.serial.*;
Serial port;
void setup() {
port = new Serial(this,"/dev/ttyUSB0",9600);
}
void draw() {
if(port.available() > 0) {
int info = port.read();
println(info);
println("===");
}
}
And here is my arduino code:
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int deg = 0;
int data = 1;
for (deg = 0; deg < 10; deg++) {
Serial.println(deg);
delay(15);
delay(1000);
}
}
Also, the board and processing are using the same port /dev/ttyUSB0. I am running all of this on Ubuntu 20.04. I tried to look on google but can't seem to find anything. Thanks in advance, any tip is welcome.