Is it possible to compile code written for Arduino on iOS?

727 Views Asked by At

I would like to be able to create a native iOS app that will let the user write an Arduino sketch, and then compile it to HEX code that can be uploaded to the Arduino board.

3

There are 3 best solutions below

2
On

It is POSSIBLE to do this (your iOS phone probably already has a compiler for OpenCL on it), but it's certainly not the most ideal platform for a fairly CPU intensive application like compilation. Mobile phones do not like to run at 100% cpu time for several seconds every minute or so, as you are debugging, editing, compiling, debugging, editing, compiling to get the Arduino code to "work right".

I sometimes run gcc on my development board(s) at work, which is comparable in performance to a mobile phone (of some reasonably modern kind), and it isn't exactly "blindingly fast", and that is for fairly small portions of code - the source code for my applications that I compile this way is typically a single file and a couple of dozen kilobytes - of course, it does include some header files.

Bear in mind also that the dev tools will probably take up several dozen megabytes of memory on the phone - I don't see it as something that many people will want to use. And of course, typing on a phone or iPad isn't exactly wonderful, no matter how good the touch techniques are these days. A real keyboard is still miles better.

1
On

Run the compiler on-line. There are already several microcontroller projects that do this and use a web GUI as a code editor.

0
On

Check out free(mium) ArduinoCode - Arduino IDE that runs on iOS. However becuase of Apple limitations you have to run tiny java app on your desktop: to do the hard work and communicate with your Arduino over USB. Wireless uploading over BLE available.