Difference: LEDsAndNopNeoPixel (1 vs. 8)

Revision 82021-06-11 - UliRaich

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

LEDs and NeoPixel

Introduction

Line: 47 to 47
 In exercise 6 the LEDs will turn on clockwise (cw). Modify the program such that the LEDs turn on counter clock wise (ccw).

The exercise sheet in odt format:

Added:
>
>

Exercise 8: The color wheel

 
Changed:
<
<
https://iotworkshop.africa/pub/IoT_Course_English/LEDsAndNopNeoPixel/exercise_2_modified.odt
>
>
color_wheel.png

Display all colors of the rainbow on all the LEDs of the LED ring. Traverse the color wheel in clockwise direction. Do not exceed a max intensity on any color component of 0x1f.

Hint: At an angle of 0°..60° the red component is at max level (0x1f), the blue component is zero and only the green component increases with increasing angle. For angles between 60° and 120° the green component is always max, the blue component is zero while the red component decreases from max to zero etc.

The exercise sheet in odt format:

https://iotworkshop.africa/pub/IoT_Course_English/LEDsAndNopNeoPixel/exercise_2.odt

  -- Uli Raich - 2020-05-05

Comments

Line: 59 to 68
 
META FILEATTACHMENT attachment="esp32.png" attr="" comment="" date="1588704164" name="esp32.png" path="esp32.png" size="231244" user="UliRaich" version="1"
META FILEATTACHMENT attachment="ledRingBack.png" attr="" comment="" date="1590133836" name="ledRingBack.png" path="ledRingBack.png" size="356910" user="UliRaich" version="1"
META FILEATTACHMENT attachment="wrover.png" attr="" comment="" date="1596961702" name="wrover.png" path="wrover.png" size="256781" user="UliRaich" version="1"
Changed:
<
<
META FILEATTACHMENT attachment="exercise_2.odt" attr="" comment="" date="1596962540" name="exercise_2.odt" path="exercise_2.odt" size="939306" user="UliRaich" version="1"
>
>
META FILEATTACHMENT attachment="exercise_2.odt" attr="" comment="" date="1623436269" name="exercise_2.odt" path="exercise_2.odt" size="1193071" user="UliRaich" version="2"
 
META FILEATTACHMENT attachment="exercise_2_modified.odt" attr="" comment="" date="1596962877" name="exercise_2_modified.odt" path="exercise_2_modified.odt" size="1088313" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="color-wheel.jpg" attr="" comment="" date="1623435889" name="color-wheel.jpg" path="color-wheel.jpg" size="253069" user="UliRaich" version="1"
META FILEATTACHMENT attachment="color_wheel.png" attr="" comment="" date="1623436135" name="color_wheel.png" path="color_wheel.png" size="269576" user="UliRaich" version="1"

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.

Revision 62020-08-09 - UliRaich

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

LEDs and NeoPixel

Introduction

Changed:
<
<
The ESP32 has 2 LEDs on board. The first one indicates power while the second one is user programmable. The user programmable built-in LED is connected to GPIO pin 2.
>
>
The ESP32 has 2 LEDs on board. The first one indicates power while the second one is user programmable. The user programmable built-in LED is connected to GPIO pin 19.
 
Changed:
<
<
esp32.png
>
>
wrover.png
  You can see the LEDs in the far left, bottom corner. The power LED is marked "ON" while the user programmable one is marked "L".
Line: 31 to 31
 

Exercise 4: Change the LED light intensity

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.

Deleted:
<
<
-- Uli Raich - 2020-05-05
 

Exercise 5: The WS2812 addressable LED

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.

Line: 46 to 44
 

Exercise 7: Change to CCW

In exercise 6 the LEDs will turn on clockwise (cw). Modify the program such that the LEDs turn on counter clock wise (ccw).

Added:
>
>
The exercise sheet in odt format:

https://iotworkshop.africa/pub/IoT_Course_English/LEDsAndNopNeoPixel/exercise_2_modified.odt

-- Uli Raich - 2020-05-05

 

Comments

<--/commentPlugin-->
Line: 53 to 57
 
META FILEATTACHMENT attachment="leds.png" attr="" comment="" date="1588704015" name="leds.png" path="leds.png" size="299673" user="UliRaich" version="1"
META FILEATTACHMENT attachment="esp32.png" attr="" comment="" date="1588704164" name="esp32.png" path="esp32.png" size="231244" user="UliRaich" version="1"
META FILEATTACHMENT attachment="ledRingBack.png" attr="" comment="" date="1590133836" name="ledRingBack.png" path="ledRingBack.png" size="356910" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="wrover.png" attr="" comment="" date="1596961702" name="wrover.png" path="wrover.png" size="256781" user="UliRaich" version="1"
META FILEATTACHMENT attachment="exercise_2.odt" attr="" comment="" date="1596962540" name="exercise_2.odt" path="exercise_2.odt" size="939306" user="UliRaich" version="1"
META FILEATTACHMENT attachment="exercise_2_modified.odt" attr="" comment="" date="1596962877" name="exercise_2_modified.odt" path="exercise_2_modified.odt" size="1088313" user="UliRaich" version="1"

Revision 52020-05-22 - UliRaich

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

LEDs and NeoPixel

Introduction

Line: 10 to 10
 You can see the LEDs in the far left, bottom corner. The power LED is marked "ON" while the user programmable one is marked "L".

The NeoPixel is based on the WS2812 addressable RGB LED which is often used in LED chains. In our case we have 6 LEDs arranged in a ring with a 7th one placed in the center of the ring.

Changed:
<
<
leds.png

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.

>
>
WS2812 LEDs front WS2812 LEDs back
leds.png ledRingBack.png
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 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
>
>
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

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.

Line: 36 to 35
 -- Uli Raich - 2020-05-05

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. Fortunatelly a driver for the WS2812 running on the ESP32 is already integrate 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.
Line: 53 to 52
 
META FILEATTACHMENT attachment="leds.png" attr="" comment="" date="1588704015" name="leds.png" path="leds.png" size="299673" user="UliRaich" version="1"
META FILEATTACHMENT attachment="esp32.png" attr="" comment="" date="1588704164" name="esp32.png" path="esp32.png" size="231244" user="UliRaich" version="1"
Added:
>
>
META FILEATTACHMENT attachment="ledRingBack.png" attr="" comment="" date="1590133836" name="ledRingBack.png" path="ledRingBack.png" size="356910" user="UliRaich" version="1"

Revision 42020-05-21 - UliRaich

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

LEDs and NeoPixel

Introduction

Line: 31 to 31
 

Exercise 4: Change the LED light intensity

Changed:
<
<
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.
>
>
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.
  -- Uli Raich - 2020-05-05
Changed:
<
<

Exercise 4: The WS2812 addressable LED

>
>

Exercise 5: The WS2812 addressable LED

  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.

Changed:
<
<

Exercise 5: Change the Colors

>
>

Exercise 6: 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.
Added:
>
>

Exercise 7: Change to CCW

In exercise 6 the LEDs will turn on clockwise (cw). Modify the program such that the LEDs turn on counter clock wise (ccw).

 

Comments

<--/commentPlugin-->

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-->

Revision 22020-05-06 - UliRaich

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

LEDs and NeoPixel

Introduction

Line: 9 to 9
  You can see the LEDs in the far left, bottom corner. The power LED is marked "ON" while the user programmable one is marked "L".
Changed:
<
<
The NeoPixel is based on the WS2812 addressable RGB LED which is often used in LED chains. In our case we have 6 LEDs arranged in a ring with a 7th on placed in the center of the ring.
>
>
The NeoPixel is based on the WS2812 addressable RGB LED which is often used in LED chains. In our case we have 6 LEDs arranged in a ring with a 7th one placed in the center of the ring.
  leds.png

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.

Added:
>
>

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

 

Exercise 1: Switching the user LED with REPL

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

Write a script that makes the LED blink at 1 Hz (500ms on, 500 ms off).

Changed:
<
<
Improve the program by capturing <ctrl> c, which stops the endless loop, switching off the LED before exiting the program.
>
>
Improve the program by capturing Ctrl-C, which stops the endless loop, switching off the LED before exiting the program. This can easily be done in a try..except clause capturing the KeyboardInterrupt exception.
 

Exercise 3: SOS

Probably the most well known Morse sequence is SOS (Save Our Souls) which consists of 3 long sounds (Morse "S") followed by 3 short ones (Morse "O") again followed by 3 long ones. Make the LED blink the SOS sequence. Pause for 1 s between 2 SOS sequences.

Revision 12020-05-05 - UliRaich

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

LEDs and NeoPixel

Introduction

The ESP32 has 2 LEDs on board. The first one indicates power while the second one is user programmable. The user programmable built-in LED is connected to GPIO pin 2.

esp32.png

You can see the LEDs in the far left, bottom corner. The power LED is marked "ON" while the user programmable one is marked "L".

The NeoPixel is based on the WS2812 addressable RGB LED which is often used in LED chains. In our case we have 6 LEDs arranged in a ring with a 7th on placed in the center of the ring.

leds.png

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.

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 of with REPL

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

Write a script that makes the LED blink at 1 Hz (500ms on, 500 ms off).

Improve the program by capturing <ctrl> c, which stops the endless loop, switching off the LED before exiting the program.

Exercise 3: SOS

Probably the most well known Morse sequence is SOS (Save Our Souls) which consists of 3 long sounds (Morse "S") followed by 3 short ones (Morse "O") again followed by 3 long ones. Make the LED blink the SOS sequence. Pause for 1 s between 2 SOS sequences.

Exercise 4: Change the LED light intensity

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

Comments

<--/commentPlugin-->

META FILEATTACHMENT attachment="leds.png" attr="" comment="" date="1588704015" name="leds.png" path="leds.png" size="299673" user="UliRaich" version="1"
META FILEATTACHMENT attachment="esp32.png" attr="" comment="" date="1588704164" name="esp32.png" path="esp32.png" size="231244" 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