Clapping music with Arduino: Difference between revisions

From XPUB & Lens-Based wiki
(Created page with "http://www.arduino.cc/en/Tutorial/Tone")
 
No edit summary
Line 1: Line 1:
http://www.arduino.cc/en/Tutorial/Tone
Arduino!
 
<source lang="c">
void setup()  {               
  pinMode(8, OUTPUT);
  for (int i=0; i<1000; i++) {
    digitalWrite(8, HIGH);
    delay(1);
    digitalWrite(8, LOW);
    delay(1);
  }
}
 
void loop () {}
</source>
 
change the argument to the delay...
 
* http://www.arduino.cc/en/Tutorial/Tone
* Starting point is the Example > Digital > toneMelody

Revision as of 19:23, 18 October 2010

Arduino!

void setup()   {                
  pinMode(8, OUTPUT);
  for (int i=0; i<1000; i++) {
    digitalWrite(8, HIGH);
    delay(1);
    digitalWrite(8, LOW);
    delay(1);
  }
}

void loop () {}

change the argument to the delay...