Pico_ada_c07_buzzer

Website:

https://pi-ada-tutorial.sourceforge.io/pico_ada_c07_buzzer

Author:
  • Martin Krischik <krischik@users.sourceforge.net>
Maintainer:
  • Martin Krischik <krischik@users.sourceforge.net>
License:

GPL-3.0-or-later

Version:

1.7.1

Alire CI:

Dependencies: Dependents:

No dependents.

Badge:

Chapter 7: Controlling active and passive Buzzer

#raspberry #pi #pico #rp2040 #tasking #light-tasking #ada2022 #embedded

Learn how to drive active and passive buzzers with the Raspberry Pi Pico using Ada. From simple doorbell switches to PWM-generated sweeping alert tones - including hardware tips with flyback diodes and oscilloscope measurements.

In this chapter we connect both active and passive buzzers to the Pico. We start with a simple button-controlled doorbell, improve the passive buzzer with bit-banging, and finally create a clean sweeping alert tone using the Pico’s PWM hardware. We also look at inductive-load protection and why a diode is essential.

Contained in Chapter 07 are:

  1. sketch_07_1_doorbell.adb - Chapter 7.1 Doorbell with active buzzer
  2. sketch_07_2_alert.adb - Chapter 7.2 Alert with passive buzzer
  3. pwm_alert.adb - Use PWM to drive an passive buzzer
  4. buzz_and_blink-main.adb - Use tasks to drive both a buzzer and an LED

Read the full tutorial at Chapter 7: Controlling a Buzzer, GNATdoc documentation, SourceForge repository