Hello fellow arduinoers, I've just spent my day teaching the magic of arduino to some of my friends.
I realized that for non programmers, such as my artist brother, it is not intuitive to write digitalRead to find if a switch is either on / off, or use digitalWrite several times to make sounds, so, I wrote a few libraries that handles the four basic components I thought a beginner normaly uses.
Summer(uint8_t pin);
void setTone(unsigned short tone);
void setTempo(unsigned int tempo);
void beep(unsigned int toneFrequency);
void playTone(unsigned int toneFrequency, unsigned short beats);
This is the library equivalent to the wellknown 'Digital->Blink'
#include <LED.h>
//create a LED object at digital pin 13
LED led(13);
void setup(){
//your setup routine here
}
void loop(){
//turn led on
led.on();
delay(1000); //wait to let us see the change
//turn led off
led.off();
delay(1000); //wait to let us see the change
}
I would greatly appreciate ideas on further functions or classes, and of course bug reports.