0

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.

  • I have never worked with an Arduino, but if the avr-gcc compiler is open source, it's of course possible. – alu Dec 10 '13 at 23:19
  • @nhgrif - I'm decently confident that we can upload the sketch to the Arduino board over Bluetooth. – Dustin Bahr Dec 10 '13 at 23:32
  • @alu - Do you know if such a thing is disallowed by Apple? – Dustin Bahr Dec 10 '13 at 23:33
  • It should't be a problem, because the compiled code isn't executed on the iDevice.However I haven't submitted yet any Apps to the real "App Store" and therefore I'm not familiar with their guidelines. – alu Dec 11 '13 at 10:57

3 Answers3

0

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.

Mats Petersson
  • 126,704
  • 14
  • 140
  • 227
  • The code we would want to compile would be very small. We want to use this as a tool to introduce programming for robotics. It would literally be a few hundred lines of code at the max. Could you point me in the right direction to research how to accomplish this? – Dustin Bahr Dec 10 '13 at 23:44
  • Typing "a few hundred lines" onto a mobile phone would be quite a painful experience, I'd say. But you'd have to build gcc for iOS, which I'd expect is possible, and then install that on the phone. If you don't need to distribute it widely, I suppose that's "job done". If you need to distribute it, I'm less certain. 500 lines of actual code, with a few headers thrown in will probably take around 15-20 seconds. Hope you don't expect to compile many times before your battery runs out, because it's not likely to happen. – Mats Petersson Dec 11 '13 at 00:03
0

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

spring
  • 18,009
  • 15
  • 80
  • 160
0

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.

4ntoine
  • 19,816
  • 21
  • 96
  • 220