Message Boards Message Boards

What is the "Arduino required sketch"?

Posted 9 years ago

Under a topic labeled Basic Examples, I see the following:

Open a connection to the Arduino and upload the required sketch to the device:

In[1] = arduino = DeviceOpen["Arduino", "COM3"]; DeviceConfigure[arduino, "Upload"];

What is the required sketch? Is it StandardFirmata or one unique to Wolfram Language? Where is the sketch file located in the software installation on the Raspberry Pi? Is there documentation available for communicating with this sketch if it is not StandardFirmata?

I am running v10 of Wolfram/Mathematica on a Raspberry Pi3. Note that COM3 above must be replaced by the RaspBian version of the USB port name that the Arduino is connected to.

POSTED BY: ken Kashmarek

Hi Ken,

The required sketch mentioned here is automatically uploaded using DeviceConfigure.

If you would like to look at this sketch you can find it at :

PacletResource["DeviceDriver_Arduino", "Sketch"]

Note that the sketch is a Mathematica formatted template, which is configured by DeviceConfigure, to look at the fully generated template you can run :

DeviceConfigure["Arduino","Upload"->{"Debug"->True}]

Then you will see the temporary folder (which is normally deleted if "Debug" isn't set to True) listed where the sketch file is located.

Note that due to a bug with the Arduino IDE, and this sketch's usage of functions returning pointers to structs, you will not be able to open up this file with the Arduino IDE and immediately upload it. For more information on this, see this blog.

Thanks,

Ian

POSTED BY: Ian Johnson
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