Itty Bitty Buggy: ColorLED Tutorial (mDesigner)
Contents
ColorLED
Buggy Base contains two ColorLEDs on the underside. Each ColorLED is capable producing a wide variety of colors. The ColorLEDs are referenced as ColorLED "A" or "B" depending on the side it resides.
[Image of underside of buggy with A/B]
Set Color block
The ColorLEDs can be controlled using the ColorLED - Set Color block.
Function: This block sets the selected ColorLED to the chosen color.
|
Example 1: Set the Color of ColorLED "A"
Note: this example is performed in online mode. If you have overwritten the firmware when using "offline mode", please follow the instructions to reset back to "online mode". |
|
|
Description: When activated, ColorLED "A" on Buggy Base will turn red.
Example 2: Set the Color of ColorLED "B"
Note: this example is performed in online mode. If you have overwritten the firmware when using "offline mode", please follow the instructions to reset back to "online mode". |
|
|
Description: When activated, ColorLED "B" on Buggy Base will turn green.
Example 3: Alternating ColorLEDs
Note: this example is performed in online mode. If you have overwritten the firmware when using "offline mode", please follow the instructions to reset back to "online mode". |
|
|
Description: When activated, the ColorLEDs on Buggy Base will alternative between being on and off. As described below.
- ColorLED "A" will turn red. ColorLED "B" will turn black (off).
- 1 second pause.
- ColorLED "A" will turn black (off). ColorLED "B" will turn green.
- 1 second pause.
- Loop forever.
Color Detector
Buggy Base also contains two Color Detector sensors on the underside, right next to the ColorLEDs. The Color Detectors are capable of detecting color. These are useful when following along a color line. The Color Detectors are referenced as Color Detector "A" or "B" depending on the side it is on.
Detect Color block
The Color Detector can be utilized using the Color Detector - Detect Color block.
Function: This block reads and returns either true or false if the selected color detector detects the selected test color.
|
Example 1: If a Color is detected, then play a note on the Buzzer
Note: this example is performed in online mode. If you have overwritten the firmware when using "offline mode", please follow the instructions to reset back to "online mode". |
|
|
Description: When activated, If Color Detector "A" detects green, then the Buzzer will play note C4 for 1 second.