Using Geany as multi-language code editor (IDE) for your Arduino project

When working on an Arduino project, you often need to create more than just one file. This could be combination of C and Python. You have the choice of switching between Python IDE like IDLE or PyCharm and a typical C CLI-based editor vim, and Arduino Genuino IDE to edit .ino file. All of which will consume a bit of more time and extra headache to learn yet another tool.

With a little modification, you can use Geany almost out-of-the box for editing various source codes. This includes most used languages like Python, C, C++, and Java. If you want to use just one IDE to do the whole lot, without switching back and forth between editors, you could harness the real power of Geany.

Install Arduino IDE

Although there are ways you can use Arduino features without the IDE, you still need the IDE’s core commands that you are going to use from within Geany, the easiest way is to install Arduino Genuino IDE.

On Debian / Ubuntu / Mint:

sudo apt-get update

sudo apt-get install arduino

On Arch based distros:

sudo pacman -S arduino

How to install Geany

On Debian / Ubuntu / Mint:

sudo apt-get update

sudo apt-get install geany

On Arch based distros:

sudo pacman -S geany

Basic usage

After install you can run it from the menu, or load it from CLI: geany

Geany is a hybrid between a simple text editor and an advance Integrated Development Environment. You can extend it the way you like, with extra plugins as per required, rather than starting with full-blown IDE  with wasted features. Well in simple engineering term, what are you realy going to do with an Arduino besides, wire it, code it, test it, launch it, and repeat, right!?

Verify and upload

If you are familiar with Arduino IDE, you can almost clone the same process with Geany. Open en existing ino file, or write a code to blink an in-built LED. Go to Build-> Build (F8). This is equivalent to your Verify function of Arduino IDE. Take a look at the verify status at the bottom part of the application.

If there is not error, the next step is to convert the code into bitcodes and upload it to your avr chip of your Arduino board. Go to Build -> Upload (F5). This will do the magic. Again verify that your upload is working well by checking the status in the Compile message box area below.

Serial monitor

The only missing feature is to monitor serial. For that you need an external program called gtkterm.

On Debian / Ubuntu / Mint:

sudo apt-get update

sudo apt-get install gtkterm

On Arch based distros:

yaourt -S gtkterm-git

Please check that your application works well by openning it from your menu, or through CLI: gtkterm.

Now we want to integrate gtkterm into Geany.

Go to Build -> Set Build Commands

Under the Arduino command, there should be a blank slot for you to enter the following details:

Set Menu Item Label =  Serial monitor

Command = gtkterm -p /dev/ttyUSB0 9600

gtkterm will take any port that you specify. In the above example port /dev/ttyUS0 on baudrate 9600 was tried successfully.

(Visited 1,958 times, 1 visits today)