I have a very simple code reading Analog input A0 and A1 in a loop with 50ms delay and printing the results to serial output at 115200 baud.
When I monitor the results on my Desktop PC the code works perfectly(sample rate >1hz) as it should and the serial LED flashes quickly(several times a second) on the Arduino UNO.
But when I connect the same board running the same code to my Laptop and monitor the serial port the data is printing much slower (sample rate <1s). and the LED on the board stays on for maybe two seconds and goes on/off quickly.(at the same time TX led flashes quickly).
Basically for some reason data is being transferred much slower.
Both computers are running windows 7 and I though the issue could be the USB driver but I checked and they both run driver version 1.1.
I also checked the USB Voltage input while connected to Desktop is 4.95V and Laptop input voltage is 5.08V.
Any ideas?
Thanks
Post the code you're running.
int fsrRead1;
int fsrRead2;
void setup() {
// initialize digital pin 13 as an output.
Serial.begin(115200);
pinMode(13, OUTPUT);
digitalWrite(13,LOW);
}
void loop() {
fsrRead1=analogRead(0);
fsrRead2=analogRead(1);
Serial.print(fsrRead1);
Serial.print(" ");
Serial.print(fsrRead2);
Serial.print("\n");
delay(50);
}
Agree - that code is so simple, I can't see anything in there that suggests anything exotic might be going on on the Arduino's side.
What IDE versions are you using? 1.6.8 has a defect with serial port handling on Windows. I recommend 1.6.5r5 (or 1.6.9 hourly for the brave and experienced), as 1.6.6 and 1.6.7 had some bugs.
On my Desktop PC I am Using 1.6.5 but the laptop is indeed 1.6.8. but the thing is I am compiling the code with 1.6.5. but i will give it a try.
The defect is in how the ide interacts with serial devices, not in the code it uploads to the board, so that would be consistent
If the IDE / SerialMonitor is the suspect, use a dedicated terminal program instead of SerialMonitor (e.g. PuTTY or RealTerm) and check the results.
It doesn't change when I use different terminal program, already tried Putty.
I uninstalled 1.6.8 and installed 1.6.5. the problem still remains.
I think the problem has to do with the Arduino USB driver, right?
I think the drivers from 1.6.8 are already installed in arduino_gemma.inf folder in System32 and when I install 1.6.5 I think it doesn't have permissions to overwrite those. I can't even manually delete them as I don't have permission to delete it . Do you guys think this could be the problem?
The problem was combination of the serial issue with the Arduino 1.6.8 and the USB drivers that were not getting deleted after uninstalling the software. I had to change permissions and manually delete the files.
Thanks to DrAzzy for recommending to install previous versions.