August 2009 Archives
/* check out how we can pass the pin number as an argument to our player function */
/* this sketch uses a melody array to set the order in which things are played, as well as millis for the over all sense of the timing. you can set the duration of each note, and the time it waits before playing the next note separately */
/* A lil more control yet /*
Futurlec is a good source for electronics for
Opto-isolated Ouput Boards: 8 x transistor for driving DC actuators upto 24V/6A
Relay 8: 8 x mechanical 12V relays for up to 220V/10A (AC or DC)
Solid State Relay Board: http://futurlec.com/SSRAC.shtml (AC)
DC Motor Controller Board: good for bi-directional control of hefty motors (DC)
Also check out their selection of Mini Boards
that do all sorts of things ranging from MP3 player boards, digital clocks, etc.
Check out this simple sketch that uses analogRead to get the value of an analog input pin (our sensor is a photo-resistor).
This sketch also uses the map() function to scales the red value to a number between 0 and 255, and then uses it to fade and LED in and out with analogWrite.
Note also that a Serial connection is established with the computer during the setup.
This allows use to use Serial.println() to monitor the values of our sensor on the computer screen.
Check out this sketch with the random(min,max) function added to the old Blink sketch.
Check out this sketch that uses the millis() function to get better control over timing.
Using millis() also allows you to have several streams of activity with their own distinct timing algorithms.