This is a series of application notes about developing Arduino programs using C instead of the official language and IDE.
The examples have been implemented on an Arduino Uno board, using AVR Libc GCC toolchain on Linux Debian; they can be applied on other Arduino boards that mount an ATMega chip, with minor modifications, and it should be possible to replicate the same result on Windows/OS X. The source code is available on balau/arduino_c Github repository.
- Programming Arduino Uno in pure C: this post shows the basics of writing a C application, compiling and uploading on Arduino Uno, with a classic LED blink program.
- Using a buzzer with Arduino in pure C: attach a piezoelectric buzzer to a digital pin and use the Timer/Counter0 to generate a square wave at the frequency you want and play notes.
- Drawing on a 7×5 LED matrix with Arduino in C: attach a LED matrix to (a lot of) digital pins, and develop a small driver to draw anything on it, being aware of current consumption and I/O limitations.
- Arduino interrupts in C: implementing a time switch: this post shows the toolchain functionalities that let the developer configure interrupts requests (IRQ) and write interrupt service routines (ISR).
- Using a rain sensor with Arduino Uno in C: an application that interfaces a rain sensor to Arduino by reading digital and analog signals, and visualizing the levels on a PWM-driven LED and a serial terminal.
This page will be updated with new application notes.