Fading LED

Site: GoLabs
Course: Fading LED
Book: Fading LED
Printed by: Guest user
Date: Thursday, 18 April 2024, 11:09 AM

Description

This project shows how to fade a LED with the Raspberry Pi.

1. Introduction

This project shows how to fade a LED with the Raspberry Pi. We cover the hardware and software setup in which we connect the GrovePi to a rotary angle sensor (a fancy name for a potentiometer). The Raspberry Pi reads the analog value and dims or fades the PWM to the LED which sets the LED’s intensity. The LED is dimmed using the potentiometer.

2. Setting up the Hardware

Simply plug the LED Module in Port D5 and the Rotary Encoder in Port A0. That’s it.


3. Running the Program

Go to the LED fade example folder:

1

cd GrovePi/Projects/LED_Fade/
Run the LED fade script:

1
python led_fade.py

You can find the source for the example here.




4. Questions

Have a question or a problem? Post it on the forums and we’ll help you out.