Message Boards Message Boards

Connect Arduino Uno to Mathematica with USB connection Properly?

Posted 5 years ago

Hi All, I have read numerous posts on how to make this connection on many forums and the inconsistency i've experienced has led me to post my problem. I am trying to connect Mathematica to my Arduino Uno through the USB port. I just want to read the Analog Pins as input on the Arduino and save the values in a list so that I could start plotting. I connect the device as

ardu = DeviceOpen["Arduino", "/dev/tty.usbmodem14101"]

And Mathematica returns enter image description here I am not sure what all the red here means. Then I ask Mathematica the following

DeviceRead[ardu, "A0"]

and Mathematica gives me enter image description here If I re-evaluate cells 1 and 2 respectively I get enter image description here
I am so troubled by this because Mathematica arbitrarily decides whether it will read pin "A0" or not. Sometimes it evaluates and other times it does not. Could anyone explain how to connect and read "A0" the correct way? The last time Mathematica allowed me to read "A0" I saved the file. Ive attached this file. I have also tried this with Windows 10 and am getting the exact same inconsistencies and have attached that as well. Any help would be much appreciated!! Thanks in advance. I am using Mathematica 12.0.0.0 on both MacOS and Windows 10.

POSTED BY: David Siegel
2 Replies
Posted 5 years ago

Just update the paclet

PacletInstall["DeviceDriver_Arduino"]
POSTED BY: Suba Thomas
Posted 5 years ago

How to Connect Arduino Uno to Mathematica with USB connection Properly?

POSTED BY: David Siegel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract