Next: , Previous: C++ Features, Up: Top

10 Arduino Sketchbook Features

If you do Arduino development using the Arduino IDE, you can use CEDET and EDE in Emacs as a replacement. So far, I have only verified usage of Arduino development with CEDET on Linux.

First, you need to install both the Arduino IDE, and arduino-mode for Emacs.

10.1 Create an Arduino Sketch (Project)

To create an arduino sketch, you will need to first use the Arduino IDE. Use the preferences to set the location of your sketchbook (where your arduino sketches will be kept.) You should also plug your Arduino into your computer, and try out one of the examples using the IDE. This will force the IDE to select the correct serial terminal to use, and it will configure other aspects of your Arduino.

Once the IDE has save your Arduino's information, Emacs will read the preferences file from the arduino IDE, and use that to development.

— Variable: ede-arduino-preferences-file

The location of personl preferences for the arduino IDE.

10.2 EDE Setup

EDE will detect arduino projects once you have used the IDE to create your arduino preferences file.

When you use EDE to compile your arduino project, it will automatically generated a Makefile that will include the helper makefile. This build system allows you to compile and upload arduino sketches into your arduino.

EDE provides the following convenience features for arduino projects:

<C-c . c>
<C-c . C>
Compile your arduino project.
<C-c . U>
Upload your arduino project to your Arduino.
<Menu: Project -> Project Options -> Serial Monitor>
Open a serial monitor to your arduino so you can interact with you sketch. This uses the Emacs serial-term command.

10.3 Serial Monitor

The Arduino IDE has a serial monitor you can use to interact with your Arduino. You can open a serial monitor in Emacs for your arduino also.

— Function: cedet-arduino-serial-monitor

Start up a serial monitor for a running arduino board. Uses serial-term.

The serial term in Emacs is imperfect in some ways becaus it can create a conflict with uploading new sketches to your Arduino, so be sure to kill it before uploading new sketches.

10.4 Arduino support for SRecode

You can create macros for use with arduino-mode. (Files that end in .pde, or .ino.) By default, a handy empty file macro can be used to create the standard setup and loop functions.

10.5 Arduino and smart completion

The Arduino environment hides a common include file for wither WProgram.h or Arduino.h, depending on the version of your IDE. The smart completion engine will automatically load these header files for buffers in arduino-mode for use in smart completion.