Snap Lesson 6: LEDs
In this lesson we will learn how to control the on board LEDs

IMG_1600

 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:

  1. set the eyes to blue at 100% brightness
  2. wait 2 seconds
  3. set the arms to dimming (fades in and out) white at speed 50
  4. wait 2 seconds
  5. set the eyes to do a double flicker of gold at speed 12
  6. wait 2 seconds
  7. set the arms to flow (fade from front to back) green at speed 30

 

Activity: LED Figure-Eight

Challenge Rules:

  1. Use your code from the previous lesson that moves in a figure-eight
  2. Add in a different color or pattern for each movement of the CoDrone