Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload an Arduino Sketch via own Android App and USB cable

I want to build my own sketch upload app for my Arduino UNO. I have an USB cable which connects my Android smartphone with my UNO. Now I'd like to do something similar to the ArduinoDroid app: Read a .ino file from my Android device, compile and upload it with MY OWN app to the Arduino Board. Can someone give a clue? That would be great, thanks!

like image 823
D. Müller Avatar asked Oct 05 '15 18:10

D. Müller


1 Answers

So there are 2 tasks here that your Android program will have to perform:

  • Compile the ino file(s).
  • Download the compiled program into the Arduino board.

The Arduino IDE uses the gcc/g++ open source compiler to compile the code. It then uses AVRDude to download the compiled source into the Arduino.

Both of these programs run on Linux, which is what Android OS is based upon. Download and install a Linux OS like Ubuntu. Then install gcc & AVRdude on that Linux OS (Google for instructions).

Once you have done that, read up on how to use both programs and play around until you get it working. Then all you have to do is have your Android program execute the same steps to compile and download the Arduino program.

Your Android program will have to somehow package or include the gcc compiler and AVRDude programs. Alternatively, you could send the ino files to a server to be compiled and then receive back the compiled program. Then all you would have to do is download the program into the Arduino.

like image 138
sa_leinad Avatar answered Jan 02 '23 12:01

sa_leinad