2009-05-24

HAL - Hardware Abstraction Library, or "Yes, I can do that, Dave."

Cheesy title aside, Hardware Abstraction Libraries are an attempt to bring the full power of Object Oriented Programming to bear on hardware interaction. In the Arduino world, the simplest example is HAL Class LED. Download the LED.zip file, and extract the LED folder to your Arduino/hardware/libraries folder. There are several other HAL classes available.

void ledDemo() { for (int i = 0; i<6; i++) { // five iterations and then blink led0 led1.on(); // LED on method delay(250); led1.off(); // LED off method delay(250); led2.toggle(); // LED toggle method - flip LED state led3.fadeIn(750); // LED fadeIn method - PWM to full on led3.fadeOut(1000); // LED fadeOut method - PWM to full off }}