Passive Buzzer Module KY-006
Shopee

Passive Buzzer Module KY-006

5.0
ขายแล้ว 1 ชิ้น
฿18
ช็อป99
แบรนด์: NoBrand
ซื้อที่ Shopee

คุณจะถูกนำไปยัง Shopee

ลิงก์นี้เป็นลิงก์พันธมิตร เราอาจได้รับค่าคอมมิชชั่นจากการสั่งซื้อ โดยราคาที่คุณจ่ายไม่เปลี่ยนแปลง

รายละเอียดสินค้า

passive buzzer module KY-006

โมดูล Passive Buzzer ใช้ไฟเลี้ยง 3.3 - 5V สามารถสร้างเสียงคนตรีได้
(เหมาะทำเสียงกันขโมย)


Description:

Pressure of work: 3.3-5V
holes for easy installation bolts fixed
size PCB: 3.3 x 1.3 cm
DuPont line length, 21 cm
modules are used. drive transistor 9012

characteristics:

no Origin vibrations require energy (frequency 2K-5K) to drive the
control frequency, you can "do, re, mi fa sol la si" the

definition of Pinter:
/*
VCC:. 5V-3.3V
GND,: ground
I /O :13
Test Ubo-r3

Code 1:เสียงเพลง
*/
int speakerPin = 13;

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) {
for (long i = 0; i
digitalWrite(speakerPin, LOW);
delayMicroseconds(tone);
digitalWrite(speakerPin, HIGH);
delayMicroseconds(tone);
}
}

void playNote(char note, int duration) {
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
if (names[i] == note) {
playTone(tones[i], duration);
}
}
}

Code 2:การแจ้งเตือน

const int buzzer = 13; //buzzer to arduino pin 13
void setup(){
pinMode(buzzer, OUTPUT); // Set buzzer - pin 13 as an output
}

void loop(){

tone(buzzer, 600); // Send 600Hz sound signal...
delay(500); // ...for 1/2 sec
noTone(buzzer); // Stop sound...
delay(500); // ...for 1/2 sec

}

สินค้าที่เกี่ยวข้อง