Passive Buzzer Magnetic Type Tone for Arduino Raspberry dll
General Passive Buzzer magnetic-type impedance 16 PASTIKAN TANDA + DAN - (GROUND) TIDAK TERBALIK KETIKA DIPASANG DALAM RANGKAIAN!!!
height: 12mm Diameter: 9.5mm Voltage: 4-8 Tone Frequency Weight: 10 g
Buzzer is generally the most commonly used is 5V (Square Wave).
Contoh kode dalam Arduino:
int buzzer =10 ;// setting controls the digital IO foot buzzer void setup () { pinMode (buzzer, OUTPUT) ;// set the digital IO pin mode, OUTPUT out of Wen } void loop () { unsigned char i, j ;// define variables while (1) { for (i = 0; i 80 ; i++) // Wen a frequency sound { digitalWrite (buzzer, HIGH) ;// send voice delay (5) ;// Delay 1ms digitalWrite (buzzer, LOW) ;// do not send voice delay (5) ;// delay ms } for (i = 0; i 100 ; i++) // Wen Qie out another frequency sound { digitalWrite (buzzer, HIGH) ;// send voice delay (3) ;// delay 2ms digitalWrite (buzzer, LOW) ;// do not send voice delay (3) ;// delay 2ms } } }