Warf Corporation Co.,Ltd.
บริษัท วาร์ฟ คอร์ปอเรชั่น จำกัด
084-0880243 , 02-0466011
โพสเมื่อ
Arduino Buzzer Module for Sensor Shield ,Arduino Buzzer Module for Sensor Shield ,,Automation and Electronics/Electronic Equipment/Modules
รหัสสินค้า
NANA-145144
ชื่อสินค้า
Arduino Buzzer Module for Sensor Shield
รายละเอียด:

Plug it and Arduino can play melodies!

This is a small buzzer for the Sensor Shield. It creates different noises based on the different frequency of I/O toggling. All you need to do is to plug in the buzzer module to sensor shield, and tell the function which pin you'd like to use, the frequency you want to hear, and the duration to play that frequency.


Building interactive work is as easy as piling bricks, just plug it to our Buzzer Module with a buckled cable, and make it looks professional and neat.

Free buckled cable is included.

 

Example code to play melody:

int BuzzerPin = 9;
int length = 15; // the number of notes
char notes[] = "ccggaagffeeddc "; // a space represents a rest
int beats[] = { 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 4 };
int tempo = 300;

void playTone(int tone, int duration) <{br> for (long i = 0; i < duration * 1000L; i += tone * 2) <{br> digitalWrite(BuzzerPin, HIGH);
delayMicroseconds(tone);
digitalWrite(BuzzerPin, LOW);
delayMicroseconds(tone);
}
}

void playNote(char note, int duration) <{br> char names[] = { 'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C' };
int tones[] = { 1915, 1700, 1519, 1432, 1275, 1136, 1014, 956 };

// play the tone corresponding to the note name
for (int i = 0; i < 8; i++) <{br> if (names[i] == note) <{br> playTone(tones[i], duration);
}
}
}

void setup() <{br> pinMode(BuzzerPin, OUTPUT);
}

void loop() <{br> for (int i = 0; i < length; i++) <{br> if (notes[i] == ' ') <{br> delay(beats[i] * tempo); // rest
} else <{br> playNote(notes[i], beats[i] * tempo);
}

// pause between notes
delay(tempo / 2);
}
}







ข้อมูลเพิ่มเติม www.warf.com


คำค้นหา:
for sensor shield arduino buzzer module

บริษัท วาร์ฟ คอร์ปอเรชั่น จำกัด

Warf Corporation Co.,Ltd.

150/24 หมู่ที่ 3 ถนนเทพารักษ์ ต.บางพลีใหญ่ อ.บางพลี จ.สมุทรปราการ 10540

084-0880243 , 02-0466011
02-3855775

Contact: ภากร หุตะสังกาศ