Wednesday, November 18, 2009

Creating A Linux Arduino Development Enviroment

I started playing with my haceduino 2009 and couldn't get it to upload sketches to my board, I played for a while trying to hit the reset switch at different times but with no luck.

I hooked the board up to a windows machine and had it uploading almost right away so this led me to my Linux machine being at fault. What to do, what to do....

So last night I played with a few different Linux distros to find one that works "right out of the box" so to speak. It had to be a mainstream distro, had to be a clean install and only need packages available from the repos so as not to have to revert to compiling from source.

This guide is to set up a machine from scratch with the latest Ubuntu release 9.10, it should work with kubuntu and xubuntu as well but I offer no warranty as to the sutablity of this guide to your own hardware and setup

INSTALLING ARDUINO IDE FOR THE HACEDUINO 2009 ATmega328 UNDER UBUNTU KARMIC KOALA

Do a fresh install of Ubuntu Karmic Koala 9.10

At the command line perform the following commands to prepare your system for the arduino IDE.
  • sudo apt-get update (Update Package list)
  • sudo apt-get upgrade (Upgrade all installed packages)
  • sudo apt-get remove brltty (Remove as it conflicts when uploading sketches)
  • sudo apt-get install sun-java6-jre avrdude gcc-avr avr-libc ftdi-eeprom (Install dependencies for the Arduino IDE)
Now that the system is ready we will install the Arduino IDE, follow the next set of commands to install the latest IDE from arduino.cc via google code

  • cd ~/ (change to your home directory)
  • wget http://arduino.googlecode.com/files/arduino-0017.tgz (Download IDE from googlecode)
  • tar xzvf arduino-0017.tgz (extract files from the archive)
  • sudo reboot (reboots the machine)
Okay with that all done and your machine rebooted you should be ready to hook up your Haceduino and upload a sketch

  • Plug your Haceduino in to a USB port and wait 10 seconds for it to connect
  • To run the IDE you need to exucute the file ~/arduino-0017/arduino this will launch the IDE
  • Go to tools/board/arduino and select Duemilanove or Nano w/ ATmega328
  • Go to tools/serial port/devttyUSBx (Select the port your board is plugged in to)
  • Load a sketch from the examples choices, the file/digital/blink is a good start to make sure it is working as it doesnt require any additional hardware apart from the haceduino and a USB cable
  • Click on the upload button second icon from the right at the top of the IDE and the sketch should compile and be uploaded to the Haceduino 2009, the red and green serial traffic LEDs should flash for a few seconds
  • You should now have an orange LED blinking on the haceduino that is different to the dit dit dah flash that was all ready on the haceduino.
  • By playing with the values in the sketch you should be able to make it blink faster or slower, why don't you have a try now.
Well all going well that should be it and you will have a Linux environment that you can program your Haceduino in, congratulations and happy hacking

No comments:

Post a Comment