I want to know, why I didn't tried the Arduino before? Arduino is such a simple way into building something useful with a microcontroller.
First I wanted to use my new Arduino Uno only using console and Emacs. I used this stuff to get started:
- avr packages on Ubuntu: avrdude gcc-avr avr-libc binutils-avr
- arduino library: http://arduino.cc/en/Main/Software (used Version 0.22)
- Makefile.master and example: https://github.com/maik/pragpub/tree/master/hacking_arduino/part1
- Arduino-mode for Emacs: https://github.com/bookest/arduino-mode
The first program I tried was really simple (blinking LED on pin 9): http://arduino.cc/en/Tutorial/Blink
Using this Makefile (the Makefile.master is in the folder above):
# Your Arduino environment. ARD_REV = 22 ARD_HOME = /opt/arduino-0022 AVR_HOME = /usr/bin ARD_BIN = /usr/bin AVRDUDE = /usr/bin/avrdude AVRDUDE_CONF = /etc/avrdude.conf # Board settings. BOARD = uno PORT = /dev/ttyACM0 PROGRAMMER = arduino # Where to find header files and libraries. INC_DIRS = ./inc LIB_DIRS = $(addprefix $(ARD_HOME)/libraries/, $(LIBS)) include ../Makefile.master
After this only connect the arduino via USB and add one LED with an resistor to pin 13 and GND. Compiling and flashing using: make upload.