August 20 2022

How to build a sketch with Arduino makefile

The best choice to build a sketch for Attiny85 is Arduino IDE. But sometimes to build my sketchs, I am using also a Geany for IDE, you can use Arduino makefile

It requires that you prepare the Linux enviroment and you must install some packages to build the sketchs. For all users with debian system by the terminal 

sudo apt-get install gcc-avr avr-libc binutils-avr avrdude

After the installation you must add some lines in your .rcbash. With nano append these lines

export ARDMK_DIR=$HOME/Arduino/ard-mk
export ARDUINO_DIR=$HOME/Arduino
export AVR_DIR=$ARDUINO_DIR/hardware/tools/avr
export PATH=$HOME/bin:$PATH:$AVR_DIR/bin

Create the folder for your project and you modify your makefile with these lines:

BOARD_TAG         = ATtinyX5
BOARD_SUB         = attiny85
ALTERNATE_CORE    = path of attiny85 core
F_CPU=16000000L

For Attiny85 core file repo on github