Message Boards Message Boards


Connect Arduino Uno to Mathematica with USB connection Properly?

Posted 1 year ago
2 Replies
2 Total Likes

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 on both MacOS and Windows 10.

2 Replies
Posted 1 year ago

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

Just update the paclet

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract