-
-
Notifications
You must be signed in to change notification settings - Fork 72
Ultrasonic module code works in classic IDE but not in Pro. #400
Comments
@NoSmoke999 can you copy/paste the results from the Java IDE and the Pro IDE? u. |
Hi and thank you for the quick response. I have performed some more testing and think I may have found the issue. The problem appears to be in the serial monitor - the Pro IDE monitor seems unable to keep up with the rapid output from the program and thus gets way behind whereas the Java IDE prints much faster and is able to keep up. This puts the Pro output seriously out of sync with changes made to the distance of the ultrasound reflecting surface and thus the appearance of erratic operation. If however I put a 500 ms delay in the program to slow down the serial output, both IDEs seem to work properly. I hope that sheds some light. I will let you know if I find anything else. BTW, I have ordered a SAMD device (Arduino MO Pro) and look forward especially to trying out the debug capability! |
hey @NoSmoke999 latency in Serial Throughput on the host side can be an annoyance. |
Thank you. :) BTW, just discovered that Trusteer (a security program) can drastically slow down compiles. Remove it and all is well. |
hey @NoSmoke999
we really appreciate this :) |
Thank you for that. I have not received the MO pro yet but will try it out as soon as it arrives and let you know if any issues arise. |
Hi @NoSmoke999 . Thanks for your valuable issue report! I see you were able to determine the cause of the problem is the limited Serial Monitor update rate. We already have a prior issue report about this at https://github.com/arduino/arduino-pro-ide/issues/394. It's best to have only a single issue per subject so we can consolidate all relevant discussion to one place, so I'll go ahead and close this in favor of that one. If you end up with additional information to share, feel free to comment in the other thread. |
Describe the bug
The following program uses the HC-SR04 ultrasonic module to measure distance of an object from the module.
It works as expected with Arduino IDE but gives erratic measurement results with Pro. It will in fact produce measurement values whether or not the module is wired to the Arduino Uno. Faulty compilation of pulseIn()?
To Reproduce
Expected behavior
Proper distance measurement results from the Pro version.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: