Snap Lesson 6: LEDs
In this lesson we will learn how to control the on board LEDs
Now we will learn how to control the on board LEDs. To do so we will learn a new block:
LED Control
- This block is what controls the LEDs
- The first box is which LEDs, arm (the parts by the propellers) or eye (the eyes in the front), and what pattern (blinking, hold, ect.)
- The second box is the color to display
- The last box will either control the brightness if the first box was a hold, or the rate of blinking if it is a pattern, either way the number use should be 0-100
So lets try to create a light show to test out this new block. I will use several of these LEDs and some waits to show the available options.
If we keep making more LEDs we can get a program like this one:
This program will:
- set the eyes to blue at 100% brightness
- wait 2 seconds
- set the arms to dimming (fades in and out) white at speed 50
- wait 2 seconds
- set the eyes to do a double flicker of gold at speed 12
- wait 2 seconds
- set the arms to flow (fade from front to back) green at speed 30
Activity: LED Figure-Eight
Challenge Rules:
- Use your code from the previous lesson that moves in a figure-eight
- Add in a different color or pattern for each movement of the CoDrone