Message Boards Message Boards


Question About MicrocontrollerEmbedCode Function

Posted 1 year ago
1 Reply
3 Total Likes

I have been trying to connect an Arduino Uno to Mathematica using the DeviceOpen function and the MicrocontrollerEmbedCode function to try to get readings from a distance sensor, using the portion of the code that connects the Arduino to Mathematica (The section is titled "Sensor Calibration") in this link except replacing the port with "COM3", since I use Windows and that was the port my arduino was connected to when I looked in my Device Manager. However, when I try running the code, I find that MicrocontrollerEmbedCode output has a red circle reading "The system cannot find the path specified", even though DeviceOpen appears to work fine, and indicates that the arduino is indeed connected to COM3. I have also verified in Arduino IDE that I can get data from my distance sensor. Attached below is my notebook file. Any help would be greatly appreciated. Thanks.



You should evaluate DeviceOpen[...] only after uploading the code using MicrocontrollerEmbedCode[...]. (Or evaluate DeviceClose[...] before evaluating MicrocontrollerEmbedCode[...]). Otherwise MicrocontrollerEmbedCode cannot connect to the mcu to upload the code.

However, it does not appear to be the only problem you are encountering. If you still face issues after removing DeviceOpen, you probably need to set the path correctly as outlined in

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

Group Abstract Group Abstract