It's very easy to use buzer.
Buzer can be connected to + and -.
By analogWrite, you should to send value 255/2 to buzer.
If you want stop buzer sound. you should to send value 0 to buzer.
Following is code to use buzer.
// you don't need to write any code into setup()
void setup() {
}
// the loop routine runs over and over again forever:
void loop() {
analogWrite(9, 255/2); // buzer sound
delay(1000);
analogWrite(9,0); // no buzer sound
delay(1000);
}
댓글 없음:
댓글 쓰기