Footmarks

DIY Arduino Digital Music Instrument - Day 2

maetel 2007. 11. 6. 21:47
Memory
Bootloader


Reset Button
ATmega8


Microprocessor


Arduino API (Programming)




sound
Frequency <=> Time




int val = 2000;

void setup()
{
  pinMode(9, OUTPUT);    // sets the digital pin as output
}

void playNote(int val) {
{
  for(int c = 0; c < 100; c++) {
    digitalWrite(9, HIGH);    //sets the LED on
    delayMicroseconds(val);    //waits for a second
    digitalWrite(9, LOW);    //sets the LED off
    delayMicroseconds(val);    //waits for a second
  }
  delay(500);
}

void loop()
{
  playNote(200);
  playNote(400);
  playNote(600);
}


조교
권아름   arum.kwon(at)gmail.com
석근국   kg.seok(at)hmail.com
SADI 제품디자인과