Difference: RgbLEDChain (1 vs. 5)

Revision 52022-10-24 - UliRaich

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

The rgb LED chain

Line: 24 to 24
 ws2812b[0] = (32,0,0) # Only the red color component is set. The LED number zero will light up in red ws2812b.write() # write the color to the LED
Changed:
<
<
We will terminate the workshop with a small project
>
>
First, do the exercises of ExerciseSheets#FourthSession, then we will terminate the workshop with a small project
  -- Uli Raich - 2022-10-16

Revision 42022-10-24 - UliRaich

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

The rgb LED chain

The LED employed on the LoLin RGB LED card is very different from the one we used on the CPU card. In fact, the card uses cascadable, addressable WS2812B color LED. rgb stands for red, blue, green. There are 3 very small colored LEDs with red, green and blue colors and by modifying the intensity of each LED different colors can be created. If all color components have the same intensity, the color observed will be white. If you want to know the details of how the WS282B works, here is its datasheet.

Changed:
<
<
Communicating with the WS2812B can be quite complex because the communication timing must be strictly respected. Fortunately, the authors of MicroPython supply a driver which makes usage of the WS2812B a child's game. The driver is a MicroPython class called NeoPixel.
>
>
Communicating with the WS2812B can be quite complex because the communication timing must be strictly respected. Fortunately, the authors of MicroPython supply a driver which makes usage of the WS2812B a child's game. The driver is a MicroPython class called NeoPixel. Here is a circuit diagram showing how the WS2812B LEDs are cascaded.

ws2812b_diagram.png

Of course, on the rgb LED shield there are seven and not 3 cascaded LEDs. In fact, there are LED chains with several hundreds of LEDs cascaded this way.

  This is how the board looks like:
leds.png ledRingBack.png
Line: 31 to 34
 
META FILEATTACHMENT attachment="leds.png" attr="" comment="" date="1665955447" name="leds.png" path="leds.png" size="299673" user="UliRaich" version="1"
META FILEATTACHMENT attachment="ledRingBack.png" attr="" comment="" date="1665955558" name="ledRingBack.png" path="ledRingBack.png" size="356910" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="ws2812b_diagram.png" attr="" comment="" date="1666617582" name="ws2812b_diagram.png" path="ws2812b_diagram.png" size="5468" user="UliRaich" version="1"

Revision 32022-10-17 - UliRaich

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

The rgb LED chain

Line: 8 to 8
  This is how the board looks like:
leds.png ledRingBack.png
Changed:
<
<
The board is jumpered to use D0 or GPIO 26 for its communication with the ESP32. All the NeoPixel driver needs to know is thee number of LEDs there are in the ring and which GPIO line to use for communication. The red green and blue color components are given as 8 bit values and can therefore range from 0 (off) to 255 (maximum brightness),
>
>
The board is jumpered to use D0 or GPIO 26 for its communication with the ESP32. All the NeoPixel driver needs to know is the number of LEDs there are in the ring and which GPIO line to use for communication. The red green and blue color components are given as 8 bit values and can therefore range from 0 (off) to 255 (maximum brightness),
  Be careful: The WS2812B is extremely bright, and you may even damage your eyes when looking straight into the LED, set to maximum brightness. I therefore recommend not to set brightness values higher than 32.
Added:
>
>
 
from machine import Pin
from neopixel import NeoPixel

Revision 22022-10-17 - UliRaich

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

The rgb LED chain

The LED employed on the LoLin RGB LED card is very different from the one we used on the CPU card. In fact, the card uses cascadable, addressable WS2812B color LED. rgb stands for red, blue, green. There are 3 very small colored LEDs with red, green and blue colors and by modifying the intensity of each LED different colors can be created. If all color components have the same intensity, the color observed will be white. If you want to know the details of how the WS282B works, here is its datasheet.

Changed:
<
<
Communicating with the WS2812B can be quite complex because the communication timing must be strictly respected. Fortunately, the authors of MicroPython supply a driver which make usage of the WS2812B a child's game.
>
>
Communicating with the WS2812B can be quite complex because the communication timing must be strictly respected. Fortunately, the authors of MicroPython supply a driver which makes usage of the WS2812B a child's game. The driver is a MicroPython class called NeoPixel.
  This is how the board looks like:
leds.png ledRingBack.png
Changed:
<
<
The board is jumpered to use D0 or GPIO 26 for its communication with the ESP32.
>
>
The board is jumpered to use D0 or GPIO 26 for its communication with the ESP32. All the NeoPixel driver needs to know is thee number of LEDs there are in the ring and which GPIO line to use for communication. The red green and blue color components are given as 8 bit values and can therefore range from 0 (off) to 255 (maximum brightness),

Be careful: The WS2812B is extremely bright, and you may even damage your eyes when looking straight into the LED, set to maximum brightness. I therefore recommend not to set brightness values higher than 32.

from machine import Pin
from neopixel import NeoPixel

NO_OF_LEDS = 7
pin = Pin(26,Pin.OUT)         # GPIO 26 is used for communication with the WS2812B
ws2812b = NeoPixel(pin,NO_OF_LEDS)
ws2812b[0] = (32,0,0)         # Only the red color component is set. The LED number zero will light up in red
ws2812b.write()               # write the color to the LED

We will terminate the workshop with a small project

  -- Uli Raich - 2022-10-16

Revision 12022-10-16 - UliRaich

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="MinimalLectures"

The rgb LED chain

The LED employed on the LoLin RGB LED card is very different from the one we used on the CPU card. In fact, the card uses cascadable, addressable WS2812B color LED. rgb stands for red, blue, green. There are 3 very small colored LEDs with red, green and blue colors and by modifying the intensity of each LED different colors can be created. If all color components have the same intensity, the color observed will be white. If you want to know the details of how the WS282B works, here is its datasheet.

Communicating with the WS2812B can be quite complex because the communication timing must be strictly respected. Fortunately, the authors of MicroPython supply a driver which make usage of the WS2812B a child's game.

This is how the board looks like:

leds.png ledRingBack.png
The board is jumpered to use D0 or GPIO 26 for its communication with the ESP32.

-- Uli Raich - 2022-10-16

Comments

<--/commentPlugin-->

META FILEATTACHMENT attachment="leds.png" attr="" comment="" date="1665955447" name="leds.png" path="leds.png" size="299673" user="UliRaich" version="1"
META FILEATTACHMENT attachment="ledRingBack.png" attr="" comment="" date="1665955558" name="ledRingBack.png" path="ledRingBack.png" size="356910" user="UliRaich" version="1"
 
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