Pico_ada_c04_pwm

Website:

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

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

GPL-3.0-or-later

Version:

1.6.0

Alire CI:

Dependencies: Dependents:

No dependents.

Badge:

Chapter 4: Analog LED with PWM

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

Building smooth breathing LEDs and flowing light bars with hardware PWM on the Raspberry Pi Pico using Ada. From jittery duty cycles to perfect linear dimming - guided by the Voltcraft MSO-5102B oscilloscope and a deep dive into PWM slice mapping on both Pico 1 and Pico 2.

In this chapter we create a reusable Pico.Analog package for PWM-based analogue output. We start with a classic breathing light, then move on to a flowing light bar. Along the way the MSO-5102B reveals the real behaviour of our code, and we discover (and fix) a subtle bug in the experimental RP2350 HAL.

Contained in Chapter 04 are:

  1. Pwm - Original PWM sample from Jeremy Grosser
  2. sketch_04_1_breathing_light - Chapter 4.1 Blink internal LED
  3. sketch_04_2_flowing_light_2 - Chapter 4.1 Project Meteor Flowing Light

Read the full tutorial at Chapter 4: Analog & PWM, GNATdoc documentation, SourceForge repository