Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:iot-open:practical:hardware:sut:esp32:emb8_1 [2024/03/04 09:29] – created pczekalskien:iot-open:practical:hardware:sut:esp32:emb8_1 [2024/04/09 13:03] (current) – [Steps] pczekalski
Line 1: Line 1:
 ====== EMB8: Controlling Smart LED stripe ===== ====== EMB8: Controlling Smart LED stripe =====
-A Smart LED stripe (also referenced as Digital LED or NEOPIXEL) is a chain of connected LEDs, commonly RGB, but other combinations such as RGBWW (Red+Green+Blue+Warm White+Cold White) or WWA (Warm White+Cold White+Amber) exist. They are controlled with just one pin/GPIO. GPIO drives a first LED in a row and the LED relays configuration to the next one, and so on. This way, they constitute a daisy chain. The most common type of LED stripes is WS2812B (RGB). Initially they were powered with 5V, but that limits the length of the chain up to some 1-2m (because of the voltage drop), so nowadays LED stripes powered with 12V and even 24V are more and more popular.\\ In this scenario you will learn how to control a small LED RGB Stripe, composed of 8 Smart (Digital) LEDs.+A Smart LED stripe (also referenced as Digital LED or NEOPIXEL) is a chain of connected LEDs, commonly RGB, but other combinations such as RGBWW (Red+Green+Blue+Warm White+Cold White) or WWA (Warm White+Cold White+Amber) exist. They are controlled with just one pin/GPIO. GPIO drives a first LED in a chain and the LED relays configuration to the next one, and so on.\\ The most common type of LED stripes is WS2812B (RGB). Initially LED Stripes were powered with 5V, but that limits the length of the chain up to some 1-2m (because of the voltage drop), so nowadays LED stripes powered with 12V and even 24V are getting more and more popular.\\ \\  
 +In this scenario you will learn how to control a small LED RGB Stripe, composed of 8 Smart (Digital) LEDs.
  
 ===== Prerequisites ===== ===== Prerequisites =====
Line 10: Line 11:
  
 There are at least two ways (algorithms) to implement this task: There are at least two ways (algorithms) to implement this task:
-  * using dummy loop with blocking (''delay(...);'') calls and+  * using dummy blocking (''delay(...);'') calls in the ''void loop();'' and,
   * using a timer (see advanced scenario below).   * using a timer (see advanced scenario below).
  
Line 29: Line 30:
 When booking a device, ensure the LED stripe is visible in the camera. When booking a device, ensure the LED stripe is visible in the camera.
 <note important>Due to the low camera dynamics, do not use the full brightness of the LEDs: off is equivalent to 0, and the full brightness of the colour is 255 (8-bit resolution, per colour). We suggest to use up to 60 or max 100.</note> <note important>Due to the low camera dynamics, do not use the full brightness of the LEDs: off is equivalent to 0, and the full brightness of the colour is 255 (8-bit resolution, per colour). We suggest to use up to 60 or max 100.</note>
-<note tip>Because of the camera characteristic and human eye characteristics, the same numerical brightness for one colour can bring much different effect in another, so setting up 60 to channel Red will have different overall experienced brightness than setting 60 to channel Blue or Green. It is natural.</note>+<note tip>Because of the camera and human eye characteristics, the same numerical brightness set for one colour can bring much different brightness experience on another, so setting up 60 to channel Red will have different overall experienced brightness than setting 60 to channel Blue or Green.</note>
  
 ==== Steps ==== ==== Steps ====
Line 54: Line 55:
   stripe.show(); //Writes colours to the LED stripe   stripe.show(); //Writes colours to the LED stripe
 </code> </code>
-Parameters are: ''setLedColorData(int index, u8 r, u8 g, u8 b);''. Note that the index is 0-based, so for our stripe validthe indexes are 0..7.+Parameters are: ''setLedColorData(int index, u8 r, u8 g, u8 b);''.\\ 
 +<note tip>Note that the index is 0-based, so in the case of our devicevalid indexes are 0...7.</note>
  
-If you want to set all LEDs in the stripe to the same colour, there is a handy function: ''setAllLedsColorData(u8 r, u8 g, u8 b);''. Remember to use the ''show();'' function afterwards.+If you want to set all LEDs in the stripe to the same colour, there is a handy function: ''setAllLedsColorData(u8 r, u8 g, u8 b);''\\ Remember to use the ''show();'' function afterwards.
  
 ==== Result validation ==== ==== Result validation ====
Line 62: Line 64:
  
 ===== FAQ ===== ===== FAQ =====
-**I cannot see the colour via the video camera**: Try to lower brightness.+**I cannot see the colour via the video camera - everything looks white...**: Try to lower the LED'brightness.
  
 +<WRAP noprint>
 ===== Project information ===== ===== Project information =====
 {{:en:iot-open:logo_iot_200_px.png?200|}}\\ {{:en:iot-open:logo_iot_200_px.png?200|}}\\
Line 80: Line 83:
 {{:en:iot-open:ccbync.png?100|}} {{:en:iot-open:ccbync.png?100|}}
 </figure> </figure>
 +</WRAP>
  
  
en/iot-open/practical/hardware/sut/esp32/emb8_1.1709544586.txt.gz · Last modified: 2024/03/04 09:29 by pczekalski
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0