We just released a sudo sergeant segment in which I presented an alternative to the Arduino IDE. This is a configuration I have implemented at my workstation. In these segments we have noticed that there have been quite a few comments and questions. I thought it would be helpful for me to provide a little more context beyond the video.
In my opinion, Arduino is a great platform for quick testing and proof of concept examples. I feel it does a lot to help people overcome the learning curve of wanting to know how to program a microcontroller. The development environment is basic and provides everything necessary to start programming right away.
The focus of the segment was on setting up an alternative to the Arduino Development Environment. It is a cross platform application based on Java. There are a few features of the software which I really like:
- cross platform
- built in serial terminal
- library manager
- example manager
- board manager
- compile and upload utility
- ability to use external editor
Those are all great features, in my opinion, the actual editor - although it does everything necessary - is not as efficient when it comes to editing. I'm not a Vi or Emacs expert, although I am quick with KDevelop. KDevelop is an Qt based IDE. It has a feature for the execution of external scripts which I leveraged to compile Arduino code while within the KDevelop IDE by pressing 'shift-F9', just like 'ctl-u' in the Ardino IDE.
I wrote a script that takes an argument which is the name of the .ino file. The script will navigate to where the source file(s) are, within relation to where it is in my system. It will then compile the code and upload it using the Arduino software, by sending it a set of arguments that include the target board for compilation, the name of the source file, and the port of the device. The scrip will also find preserve and list the temp files. I did this for my own curiosity because I wanted to see what Arduino actually creates and what it is really doing.
I found out what arguments to send Arduino by checking compilation and upload options of "Show verbose output during:" in the preferences menu of the Arduino IDE. Then I read through the Arduino compile and upload output. I also read through the Arduino manpage for additional information.
Here is the script, I name it "Programmer.sh":
clear; programTitle="${1}"; programFind="`find ../Development -name ${programTitle}`"; programPath="${programFind%/*}"; programName="${programFind##*/}"; cd "${programPath}/${programName}"; currentPath="`pwd`"; echo; echo "Program Info"; echo; echo "Program Title = ${programTitle}"; echo "Program Find = ${programFind}"; echo "Program Path = ${programPath}"; echo "Program Name = ${programName}"; echo "Current Path = ${currentPath}"; echo; # this is where arduino does all the work arduino --board adafruit:avr:feather32u4 --verbose-build --verbose-upload --preserve-temp-files --upload --port /dev/ttyACM0 ${programName}.ino programBuildTmpPath="`find /tmp -name ${programTitle}.ino.elf 2>/dev/null | sed 's|^/tmp/||' `" # | sed 's|^/tmp/||'"; #find /tmp \( -not -readable -o -not -executable \) -prune -name 'adruino_build*' programBuild="`dirname ${programBuildTmpPath}`"; programBuildPath="/tmp/${programBuild}"; programParentPath="`dirname ${currentPath}`"; programBuildPathNew="${programParentPath}/${programTitle}_Build"; echo "Program Info"; echo; echo "Program Title = ${programTitle}"; echo "Program Find = ${programFind}"; echo "Program Path = ${programPath}"; echo "Program Name = ${programName}"; echo "Current Path = ${currentPath}"; echo; echo "Program Build Info"; echo; echo "Program Build Path Tmp = ${programBuildPath}";
What experiences do you have with alternatives to the Arduino development environment?