-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Analog Read issues when two megas connected to PC #104
Comments
`
` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hardware setup:
Two Arduino Megas 2560 are connected to my PC (COM5, COM6) over USB, they take up two USB plugs on a 4:1 USB dock.
Software setup:
-Both Megas have standardFirmata.c loaded onto them.
-Pyfirmata package used in my python code to, at 1s intervals, do an analog read from 12 analog input pins on each mega (24 reads total per second)
-In case this has any relevance, the code is displaying these analog reads on a dash app, and there's a callback at 1s intervals in the dash python code to do the analog reads
Issue:
When I have just one of the two Megas connected, I get expected readings. However when both are connected via USB, one mega (COM5) seems to repeatedly give the first reading it gave, and never really changes from that reading (exact same voltage reading down to the 3rd decimal place). It's almost like it's unable to give a new reading or just keeps dumping the same first reading to the serial port buffer. I know the reading update function is correctly written because when I disconnect the COM6 Arduino and rerun the dash app, all of a sudden COM5 reads as expected and does change according to sensor input and noise.
I'm wondering if there's some quirk with pyfirmata that requires some minimum time delay before reading from one COM vs a second COM port?
For further context, both Megas can be connected at the same time and the digital write functions work perfectly fine for both simultaneously.
The text was updated successfully, but these errors were encountered: