Since the device drivers for Arduino used by
DeviceExecute have very poor performance for writing and receiving serial data to/from Arduino compared with the device drivers for a standard serial port I decided to write my own event handler sketch for Arduino.
All works reasonably well: the Arduino listens on the serial port for a number of specified commands + parameters and an appropriate state machine executes some code and returns the result to mathematica via serial. I started writing some functions in Mathematica to automatically generate the C code for the Arduino like with
DeviceExecute and would like to upload the code via Mathematica as well.
Mathematica clearly has this ability build-in already (see
DeviceConfigure) but the internals are not documented. With the spelunking package I searched through the
ArduinoLink namespace and found functions that seem to do all the magic behind the scene but I am lost at the wall of code that are
arduinoCompile. Has anybody played with those or another method of uploading to an Arduino from within Mathematica?