Monday, March 5, 2012

Arduino Lab on the Syntax

Blink without delay:
it sets pin 13 as output for the LED, the place to plug in the LED, this is a constant meaning it doesnt change. Then it sets the changing information or variables.
I think what the code is doing is setting up so that the program checks the time that has passed between blinks. If the time that has passed is more than the interval time you want, the program will blink the LED. If the LED was on when the time interval was reached, it would turn it off. If it was off, it would turn it on.

tone melody:
the library holds all the information you need to program all the different notes to make different melodies.
It states the meoldy to be played and then sets the duration of each note. The 4 means a quarter note and 8 means an eigth note. It then tells the program how to determine the duration. It will divide 1000ms by the note duration of 4 or 8. The code then does on to set a pause between the notes. The pause is defined as the note duration plus 30%. There is no loop so the melody does not repeat.

No comments:

Post a Comment