C library for Arduino – Preview
I’m working on a C library for Arduino hardware. The goal is to make it just as easy as the Arduino programming language but in plain standard C. The Arduino language is halfway between C and C++. While Arduino hardware uses the same Atmel atmega168 and atmega328 that I’ve come to love, the software does not allow me to code in standard C. It prevents one from being able to borrow all of the standard C and assembly (easily) that is out there for AVR micros. More importantly, it means that I have to load up a java IDE instead of just using the GNU command line tools such as avr-gcc, avr-libc, and make. By using the Arduino hardware, we get access to mass produced hardware and the Arduino bootloader. The Arduino hardware is handy because we can program it over the same interface as we use for printf() debugging. Also, since it can get its power over USB, it bundles up lots of the initial hurdles of getting started with micros.
Already the library supports:
serial – printf(), getchar(), etc
standard I/O – easily make pins input or output, set pins high and low
pwm – LED brightness, motor control
pwm servo – control RC servos
adc – read analog values
Here is a preview reading analog in with the ADC and controling the brightness of an LED using PWM:
I’m still working on making the wiki page match this blog and storing the code in SVN. For an early preview, check out http://tinkerish.com/wiki/.