Difference: LEDsAndNopNeoPixel (2 vs. 3)

Revision 32020-05-19 - UliRaich

Line: 1 to 1
 
META TOPICPARENT name="Exercises"

LEDs and NeoPixel

Introduction

Line: 13 to 13
  leds.png
Changed:
<
<
Again the LEDs are accessible, this time through a dedicate serial protocol, on a GPIO line. For the board we are using the GPIO line can be selected with solder jumpers.
>
>
Again the LEDs are accessible, this time through a dedicate serial protocol, on a GPIO line. For the board we are using the GPIO line can be selected with solder jumpers. The jumpers were set to D0 or GPIO 26.
 

Further introductory remarks:

In comparison with the first exercise session these exercises are rather simple. This is mainly due to the fact that all difficulties in accessing the devices is hidden from you in the drivers which are part of MicroPython. If you want to know what is going on behind the scene please have a look at https://www.parallax.com/sites/default/files/downloads/28085-WS2812B-RGB-LED-Datasheet.pdf

Line: 34 to 34
 The light intensity on the LED can be changed if we do not supply a fixed signal level to it but a frequency. The duty cycle of the signal determines the light intensity. Write a program that increases the intensity in a linear fashion and the decreases it again linearly.

-- Uli Raich - 2020-05-05

Added:
>
>

Exercise 4: The WS2812 addressable LED

 
Added:
>
>
The WS2812 LED is often used in LED chains. It is an RGB LED using a single data line which can be cascaded. It has a data in pin and a data out pin where the data out pin is connected to the data in pin of the following LED. It uses a serial protocol that must be precisely timed. For more information please consult the data sheet. Fortunatelly a driver for the WS2812 running on the ESP32 is already integrate into the MicroPython binary.

Warning: The WS2812 produces very bright light! Do not look into it directly or reduce the light intensity by software.

The RGB LED chain has 7 LEDs installed on its PCB. Write a program that allows you to find out which LED corresponds to which address. To do so, please switch on a single LED e.g. its red component, and print out the corresponding address. Wait for 5s before you switch on the next LED. Only a single LED should light for each of the seven addresses.

Exercise 5: Change the Colors

Write a program that consecutively switches on the LEDs in different colors. First switch on the red component of the LED with address 0 then add the one with address 1 etc. Once all LEDs are red, switch them off again, change the color to green and repeat the cycle. Finally do the same for the blue component. Wait for 1 s before switching the LEDs.

 

Comments

<--/commentPlugin-->
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback