source

pico_ada_c05_rgb

1.6.0

Chapter 5: Controlling an RGB LED with PWM

1.6.0

Learn how to drive a common-cathode RGB LED using the RP2040's PWM peripherals. This chapter introduces a reusable Ada package for colour control and demonstrates both random colours and a smooth colour-wheel gradient.

Extend the simple LED examples to full-colour control with an RGB LED. Create a reusable Pico.Analog.RGB_LED package and explore two sketches: random colours (using the embedded runtime) and a smooth colour-wheel transition.

Contained in Chapter 05 are:

  1. sketch_05_1_random_color_light.adb - Chapter 5.1 Random Color Light
  2. sketch_05_2_gradient_color_light.adb - Chapter 5.2 Gradient Color Light

Read the full tutorial at Chapter 5: Controlling an RGB LED with PWM, GNATdoc documentation, SourceForge repository