<h1>Arduino Software Environment on FoxBoard</h1>

<p class="abstract">
BeeBoard has been designed to work in harmony with the FoxBoard. This article illustrates how to install the Arduino Environment on the FoxBoard G20.
</p>

Through this guide, you can compile codes and upload it to the i/o board.


## Requirements

* a FOX Board G20
* a Bee Board
* a mini USB to standard USB cable
* an ethernet cable to wire the FOX to your LAN
* a PC with Linux, Windows or MAC wired on the same LAN

## Step-by-step guide

* Plug the LAN cable.
* Plug the USB cable between Bee and Fox USB port.
* Remotely access to the FOX command line ([learn more about ssh access...](http://www.acmesystems.it/foxg20_ssh)).

## Installing avrdude

Debian Lenny package of avrdude do not have support for ATmega328P, so download version 5.6 and compile it.

<pre class="minicom">
apt-get install make bison byacc flex gawk
wget http://download.savannah.gnu.org/releases/avrdude/avrdude-5.6.tar.gz
tar -zxvf avrdude-5.6.tar.gz
cd avrdude-5.6
cp avrdude.conf /etc/
./configure
make
make install
</pre>

Otherwise Squeeze have version 5.10 so just install it from packages:

<pre class="minicom">
apt-get install avrdude
</pre>

## Creating and compiling sketch

Install compiler and download Arduino Sources:

<pre class="minicom">
apt-get install gcc-avr avr-libc
wget http://arduino.googlecode.com/files/arduino-0022-src.tar.gz
tar -xzvf arduino-0022-src.tar.gz
mkdir /usr/share/arduino
cp -pr arduino-0022/hardware /usr/share/arduino/
cp -pr arduino-0022/libraries /usr/share/arduino/
</pre>

Makefile allows you to build sketches from the command line without the Arduino environment (or Java).
It is modified to adapt to ATmega328, library path, serial port device and some other changes to align it with the 0022 version.
Download it:

<pre class="minicom">
git clone https://github.com/Madefree/arduinoMakefile.git
</pre>

Copy Makefile into the folder with your sketch.
There should be a file with the same name as the folder and with the extension .pde (e.g. foo.pde in the foo/ folder).
At the command line, change to the directory containing your program's file and the makefile.
Open Makefile and check parameter PORT like serial device you use (ttyUSB0, ttyS2, etc.).
Compile and upload your program:

<pre class="minicom">
make
make upload
</pre>

## Replace the Arduino IDE with Vim

* Install Vim if you don't have
<pre class="minicom">
apt-get install vim
</pre>

* Then follow this [Vim Wiki page](http://www.vim.org/scripts/script.php?script_id=2654)

Note: In Squeeze the Vim syntax folder is: /usr/share/vim/vim72/syntax/

## Related links

* [Madefree web site](http://beeboard.madefree.eu/doku.php/software_tools:install_ide_on_foxg20)
* [Bee Board PINOUT](http://www.acmesystems.it/beeboard_pinout)


@shop='BEEBOARD'
@shop='BEEKIT-1'
@shop='BEEKIT-2'

