Difference between revisions of "Itty Bitty Buggy: ColorLED Tutorial (mDesigner)"

From Microduino Wiki
Jump to: navigation, search
(Example 1: Set the Color of ColorLED "A")
(Example 3: Alternating ColorLEDs)
 
(33 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
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.
 
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]
+
[file:Image of underside of buggy with A/B]
  
==Set Color block==
+
==Block: Set Color==
 
The ColorLEDs can be controlled using the '''ColorLED - Set Color''' block.
 
The ColorLEDs can be controlled using the '''ColorLED - Set Color''' block.
  
Line 20: Line 20:
 
{| class="wikitable" style="background-color:#FEF9E7;"
 
{| class="wikitable" style="background-color:#FEF9E7;"
 
|'''Note:''' this example is performed in '''online mode'''.<br>
 
|'''Note:''' this example is performed in '''online mode'''.<br>
If you have overwritten the firmware when using "offline mode", [[please follow the instructions to reset back to "online mode".]]
+
If you have overwritten the firmware when using "offline mode", [[Itty_Bitty_Buggy:_Getting_Started_(mDesigner)#Connecting_to_Itty_Bitty_Buggy_to_mDesigner_.28Online_mode.29|'''please follow the instructions to reset back to "online mode"'''.]]
 
|}
 
|}
  
Line 53: Line 53:
 
{| class="wikitable" style="background-color:#FEF9E7;"
 
{| class="wikitable" style="background-color:#FEF9E7;"
 
|'''Note:''' this example is performed in '''online mode'''.<br>
 
|'''Note:''' this example is performed in '''online mode'''.<br>
If you have overwritten the firmware when using "offline mode", [[please follow the instructions to reset back to "online mode".]]
+
If you have overwritten the firmware when using "offline mode", [[Itty_Bitty_Buggy:_Getting_Started_(mDesigner)#Connecting_to_Itty_Bitty_Buggy_to_mDesigner_.28Online_mode.29|'''please follow the instructions to reset back to "online mode"'''.]]
 
|}
 
|}
  
Line 68: Line 68:
 
|-
 
|-
 
|Buggy [[File:IBB_Buggy_icon.png|x30px]]
 
|Buggy [[File:IBB_Buggy_icon.png|x30px]]
|[[File:IBB_mDesigner_ColorLED_Set_Color_NoLabels.png|x50px]] [[File:Info_icon.png|24px|link=Buggy_Base_(use_with_mDesigner)#ColorLED_-_Set_Color]]
+
|[[File:IBB_mDesigner_ColorLED_Set_Color_NoLabels.png|x50px|link=Buggy_Base_(use_with_mDesigner)#ColorLED_-_Set_Color]] [[File:Info_icon.png|24px|link=Buggy_Base_(use_with_mDesigner)#ColorLED_-_Set_Color]]
 
|}
 
|}
  
Line 86: Line 86:
 
{| class="wikitable" style="background-color:#FEF9E7;"
 
{| class="wikitable" style="background-color:#FEF9E7;"
 
|'''Note:''' this example is performed in '''online mode'''.<br>
 
|'''Note:''' this example is performed in '''online mode'''.<br>
If you have overwritten the firmware when using "offline mode", [[please follow the instructions to reset back to "online mode".]]
+
If you have overwritten the firmware when using "offline mode", [[Itty_Bitty_Buggy:_Getting_Started_(mDesigner)#Connecting_to_Itty_Bitty_Buggy_to_mDesigner_.28Online_mode.29|'''please follow the instructions to reset back to "online mode"'''.]]
 
|}
 
|}
  
Line 101: Line 101:
 
|-
 
|-
 
|bgcolor=FEAD50|Control
 
|bgcolor=FEAD50|Control
|[[File:mDesigner_v1.6_Wait_block.png|x50px]] [[File:Info_icon.png|24px|link=block_reference]]<br>
+
|
 +
[[File:mDesigner_v1.6_Wait_block.png|x50px]] [[File:Info_icon.png|24px|link=block_reference]]<br><br>
 
[[File:mDesigner_v1.6_Forever_block.png|x75px]] [[File:Info_icon.png|24px|link=block_reference]]
 
[[File:mDesigner_v1.6_Forever_block.png|x75px]] [[File:Info_icon.png|24px|link=block_reference]]
 
 
|-
 
|-
 
|Buggy [[File:IBB_Buggy_icon.png|x30px]]
 
|Buggy [[File:IBB_Buggy_icon.png|x30px]]
|[[File:IBB_mDesigner_ColorLED_Set_Color_NoLabels.png|x50px]] [[File:Info_icon.png|24px|link=Buggy_Base_(use_with_mDesigner)#ColorLED_-_Set_Color]]
+
|[[File:IBB_mDesigner_ColorLED_Set_Color_NoLabels.png|x50px|link=Buggy_Base_(use_with_mDesigner)#ColorLED_-_Set_Color]] [[File:Info_icon.png|24px|link=Buggy_Base_(use_with_mDesigner)#ColorLED_-_Set_Color]]
 
|}
 
|}
  
Line 119: Line 119:
 
|}
 
|}
  
'''Description:''' [[how to activate blocks|When activated]], the ColorLEDs on Buggy Base will alternative between being on and off. As described below.
+
'''Description:''' [[how to activate blocks|When activated]], the ColorLEDs on Buggy Base will alternative between being on and off. As described below.<br><br>
 +
The following will loop forever:
 
*ColorLED "A" will turn red. ColorLED "B" will turn black (off).
 
*ColorLED "A" will turn red. ColorLED "B" will turn black (off).
 
*1 second pause.
 
*1 second pause.
 
*ColorLED "A" will turn black (off). ColorLED "B" will turn green.
 
*ColorLED "A" will turn black (off). ColorLED "B" will turn green.
 
*1 second pause.
 
*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.
 
 
{| class="wikitable"
 
|
 
'''Function:''' This block reads and returns either '''true''' or '''false''' if the selected color detector detects the selected test color.
 
 
:[[File:IBB mDesigner LineFInder Block Test Color.png]]
 
 
:*'''Sensor''' - select sensor for detection (either '''A''' or '''B''').
 
 
:*'''Color''' - color for the selected '''Sensor''' to match in order to return '''true'''. Otherwise, this block returns '''false'''.
 
|}
 
==Example 1: If a Color is detected, then play a note on the Buzzer==
 
{| class="wikitable" style="background-color:#FEF9E7;"
 
|'''Note:''' this example is performed in '''online mode'''.<br>
 
If you have overwritten the firmware when using "offline mode", [[please follow the instructions to reset back to "online mode".]]
 
|}
 
 
{|
 
 
|style="vertical-align:top;"|
 
{| class="wikitable"
 
|+Blocks Used
 
!Block Category
 
!Blocks
 
|-
 
|bgcolor=FEC254|Events
 
|[[File:MDesigner_When_Click_Green_Flag_block_new.png|x50px]] [[File:Info_icon.png|24px|link=block_reference]]
 
|-
 
|bgcolor=FEAD50|Control
 
|[[File:mDesigner_v1.6_Wait_block.png|x50px]] [[File:Info_icon.png|24px|link=block_reference]]<br>
 
[[File:mDesigner_v1.6_Forever_block.png|x75px]] [[File:Info_icon.png|24px|link=block_reference]]<br><br>
 
[[File:mDesigner_v1.6_If_block.png|x75px]] [[File:Info_icon.png|24px|link=block_reference]]
 
|-
 
|Buggy [[File:IBB_Buggy_icon.png|x30px]]
 
|[[File:IBB_mDesigner_LineFInder_Block_Test_Color_NoLabels.png|x50px]] [[File:Info_icon.png|24px|link=block_reference]]<br>
 
[[File:IBB_mDesigner_Buzzer_Block_Play_Note_NoLabels.png|x50px]] [[File:Info_icon.png|24px|link=block_reference]]
 
|}
 
 
|style="vertical-align:top;"|
 
{| class="wikitable"
 
|+Example
 
|-
 
|style="padding:50px;"|
 
[[File:IBB_mDesigner_Color_Detector_Example1.png]]
 
|}
 
 
|}
 
 
'''Description:''' [[how to activate blocks|When activated]], when Color Detector "A" detects green, then the Buzzer will play note C4 for 1 second.
 

Latest revision as of 19:39, 30 October 2018

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.

[file:Image of underside of buggy with A/B]

Block: Set Color

The ColorLEDs can be controlled using the ColorLED - Set Color block.

Function: This block sets the selected ColorLED to the chosen color.

IBB mDesigner ColorLED Set Color.png
  • ColorLED - select ColorLED to set color for (either A or B).
  • Color - color to set selected ColorLED to.

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

Blocks Used
Block Category Blocks
Events MDesigner When Click Green Flag block new.png Info icon.png
Buggy IBB Buggy icon.png IBB mDesigner ColorLED Set Color NoLabels.png Info icon.png
Example

IBB mDesigner ColorLED Example1.png

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

Blocks Used
Block Category Blocks
Events MDesigner When Click Green Flag block new.png Info icon.png
Buggy IBB Buggy icon.png IBB mDesigner ColorLED Set Color NoLabels.png Info icon.png
Example

IBB mDesigner ColorLED Example2.png

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

Blocks Used
Block Category Blocks
Events MDesigner When Click Green Flag block new.png Info icon.png
Control

MDesigner v1.6 Wait block.png Info icon.png

MDesigner v1.6 Forever block.png Info icon.png

Buggy IBB Buggy icon.png IBB mDesigner ColorLED Set Color NoLabels.png Info icon.png
Example

IBB mDesigner ColorLED Example3.png

Description: When activated, the ColorLEDs on Buggy Base will alternative between being on and off. As described below.

The following will loop forever:

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