Difference: LEDsAndNopNeoPixel (6 vs. 7)

Revision 72021-02-07 - IsaacArmahMensah

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

LEDs and NeoPixel

Introduction

Line: 15 to 15
 Again the LEDs are accessible, this time through a dedicated serial protocol, on a single GPIO line. For the board we are using the GPIO line can be selected with solder jumpers. If you look at the photo of the board's back side very closely you will see that the jumper was set to D0 or GPIO 26 on the ESP32.

Further introductory remarks:

Changed:
<
<
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 are 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

Exercise 1: Switching the user LED with REPL

>
>
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 are 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://www1.parallax.com/sites/default/files/downloads/28085-WS2812B-RGB-LED-Datasheet.pdf

Exercise 1: Switching the user LED with REPL

  It is actually very easy to access the LED because all you need is already available in MicroPython. Just look it up at
https://docs.micropython.org/en/latest/esp32/quickref.html#pins-and-gpio and try the example using GPIO pin 2. Don't write a script just yet but switch the LED on and off with REPL.

Exercise 2: The Embedded System's Hello World Program: The blinking LED

Line: 33 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. This is called Pulse Width Modulation or PWM for short. Write a program that increases the intensity in a linear fashion and the decreases it again linearly.

Exercise 5: The WS2812 addressable LED

Changed:
<
<
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. Fortunately a driver for the WS2812 running on the ESP32 is already integrated into the MicroPython binary.
>
>
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. Fortunately a driver for the WS2812 running on the ESP32 is already integrated into the MicroPython binary.
  Warning: The WS2812 produces very bright light! Do not look into it directly or reduce the light intensity by software.
 
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