I'm trying to communicate some numbers between a Linux program and my Ardunino Uno. To this end I wrote a C++ program which somehow contains:
#include <stdio.h>
int a,b;
a = 1;
b = 2000;
File* serial = fopen("/dev/ttyACM0","w");
fprintf(serial,"%d,%d\n",a,b);
fclose(serial);
Now out of standards I guess, the baud rate is 9600 bit/s. If I use stty -F /dev/ttyACM0 115200
I can change the baude rate of that port to 115200 bit/s. However the communication does not work anymore. My arduino program waiting for number,number
does not show any action to the same code as before. Oh, and in the Arduino program of course I changed the code to serial.begin(115200);
.
How can I change the baude rate in such a setup? If it is a concern, I'm using Ubuntu and an Arduino Uno.