The LED control block in the gray CoDrone menu is exactly what it sounds like --- it lets you control the CoDrone's LEDs! You need to set three things within the block:
- The first drop-down menu is the mode and lets you select which LEDs will light up and the pattern they will display.
- The second drop-down menu lets you choose which color to display in the pattern.
- The value space is the time and lets you control the speed of the pattern. If you chose a hold pattern, this will let you control the brightness of the LEDs.
If you want to make multiple LED changes in your program, you can do that! All you need to do is include an LED control block for each change you want. Make sure to separate them with a wait secs block so your CoDrone has time to receive each of the commands.
Modes and colors
The mode sets the LEDs in the CoDrone's eyes and arms to different patterns.
- Eye and Arm Hold will keep the LEDs on.
- Eye and Arm Mix will cycle through all of the colors.
- Eye and Arm Flicker will turn the LEDs on and off very quickly.
- Eye and Arm Flicker Double will turn the LEDs on twice and then off before starting again.
- Eye and Arm Dimming will have the LEDs fade in and out gently.
- Arm Flow will turn each arm LED on and then off before moving to the next arm. Arm Flow Reverse is the same thing, but in the opposite direction!
You have a lot of options to work with! For a complete list, click here. Anything that is highlighted in black will not actually have a black background --- it was just used to provide enough contrast for you to see. Just know that some of them look very similar to each other and if you have two similar colors next to each other in your program, it may not look like the LEDs are changing.
Time lets you control how many times your pattern changes per second, and you can pick a number from 1 to 100! For example, if you chose flicker and have a time of 47, your LEDs will blink 47 times per second.
However, if you chose hold, time controls the brightness of your LEDs. 0 is so dark you can barely see it, and 100 is full brightness.
Test it out!
To start your code, select the when green flag clicked button, connect an LED control block to it, add a wait secs block, and then repeat as many times as you need to until you have the lights you want! Play with the different patterns, colors, and times to see what you like.
Are you in a group with a lot of CoDrone pilots? Try to make a color and pattern mix that's unique to you so you can tell your CoDrone apart from the others!
Activity: Colorful figure eight
Choreograph a light show using what you learned from this lesson and your figure eight code from 2G: Flight Movements Part 2!
- Use your figure eight code from the previous lesson.
- Add in a different color or pattern for each of the CoDrone's movements.
NOW CHOREOGRAPH A DRONE LIGHT SHOW!