Beschrijving
2 kinds of buzzers exist: active and a passive. They look exactly the same but they are not. A passive buzzer is about the same as a loudspeaker. An active buzzer is comparable to a loudspeaker with build-in amplifier and tone generator. The active buzzer only needs 5Vdc applied to it and it will sound. At only one frequency though. The passive buzzer needs an wave applied to it to make sound and thus acts just like a normal loudspeaker. The passive buzzer has the + on the housing mounted away from the pins, in contrast to the active buzzer where the + on the housing is facing towards the pins. The active buzzer has its own KY-012 page.
So the Arduino must make a wave for this buzzer to sound. This can be accomplished in several ways:
- Take a pin and just keep on pulling it up and down in a fast pace. Any DIO pin will do and no other resources are used.
- Use PWM. This creates a sound but needs a PWM output and therefore also the timer belonging to the PWM.
- Use tone command. If you want to be able to use the tone command then you must connect this buzzer to a PWM pin. The tone command also uses different timers and it turns out that this timer conflicts with the IR-receiver, which also needs timers.
Warning: include(/var/www/html/robotigs/includes/wishlistperpart.php): Failed to open stream: No such file or directory in /var/www/html/robotigs/includes/parts_header.php on line 128
Warning: include(): Failed opening '/var/www/html/robotigs/includes/wishlistperpart.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/robotigs/includes/parts_header.php on line 128
|