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

From Microduino Wiki
Jump to: navigation, search
(Example 1: Set move direction of Buggy Base)
(Example 4: Zig-zagging)
 
(24 intermediate revisions by the same user not shown)
Line 23: Line 23:
 
==Example 1: Set move direction of Buggy Base==
 
==Example 1: Set move direction of Buggy Base==
 
{| class="wikitable" style="background-color:#FEF9E7;"
 
{| class="wikitable" style="background-color:#FEF9E7;"
|'''Note:''' this example is can be performed in '''online''' or '''offline mode'''.<br>
+
|'''Note:''' this example is performed in '''offline mode''' [[File:Info_icon.png|24px|link=no_link]].<br>
If you plan to use '''online''' mode and previously used '''offline''' mode, [[please follow the instructions to reset back to "online mode".]]
 
 
|}
 
|}
 
 
{|
 
{|
  
Line 39: Line 37:
 
|-
 
|-
 
|Buggy [[File:IBB_Buggy_icon.png|x30px]]
 
|Buggy [[File:IBB_Buggy_icon.png|x30px]]
|[[File:IBB_mDesigner_ColorLED_Set_Color_NoLabelsa.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]]
+
|[[File:IBB_mDesigner_Car_Block_Direction_Speed_Duration_NoLabels.png|x50px|link=Buggy_Base_(use_with_mDesigner)#Car_-_Move]] [[File:Info_icon.png|24px|link=Buggy_Base_(use_with_mDesigner)#Car_-_Move]]
 
|}
 
|}
  
Line 56: Line 54:
 
==Example 2: Move forward, then backwards==
 
==Example 2: Move forward, then backwards==
 
{| class="wikitable" style="background-color:#FEF9E7;"
 
{| class="wikitable" style="background-color:#FEF9E7;"
|'''Note:''' this example is can be performed in '''online''' or '''offline mode'''.<br>
+
|'''Note:''' this example is performed in '''offline mode''' [[File:Info_icon.png|24px|link=no_link]].<br>
If you plan to use '''online''' mode and previously used '''offline''' mode, [[please follow the instructions to reset back to "online mode".]]
 
 
|}
 
|}
 
 
{|
 
{|
  
Line 70: Line 66:
 
|bgcolor=FEC254|Events
 
|bgcolor=FEC254|Events
 
|[[File:MDesigner_When_Click_Green_Flag_block_new.png|x50px]] [[File:Info_icon.png|24px|link=block_reference]]
 
|[[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_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_NoLabelsa.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]]
+
|[[File:IBB_mDesigner_Car_Block_Direction_Speed_Duration_NoLabels.png|x50px|link=Buggy_Base_(use_with_mDesigner)#Car_-_Move]] [[File:Info_icon.png|24px|link=Buggy_Base_(use_with_mDesigner)#Car_-_Move]]
 
|}
 
|}
  
Line 85: Line 85:
 
|}
 
|}
  
'''Description:''' [[how to activate blocks|When activated]], Buggy Base will move forward at half speed (127) for 2 seconds, then move backwards at half speed (127) for 2 seconds. Then repeat.
+
'''Description:''' [[how to activate blocks|When activated]], Buggy Base will repeatedly move forward at half speed (127) for 2 seconds, then move backwards at half speed (127) for 2 seconds.
  
 
==Block: Turn==
 
==Block: Turn==
Line 106: Line 106:
 
==Example 3: Turning left==
 
==Example 3: Turning left==
 
{| class="wikitable" style="background-color:#FEF9E7;"
 
{| class="wikitable" style="background-color:#FEF9E7;"
|'''Note:''' this example is can be performed in '''online''' or '''offline mode'''.<br>
+
|'''Note:''' this example is performed in '''offline mode''' [[File:Info_icon.png|24px|link=no_link]].<br>
If you plan to use '''online''' mode and previously used '''offline''' mode, [[please follow the instructions to reset back to "online mode".]]
 
 
|}
 
|}
  
Line 122: Line 121:
 
|-
 
|-
 
|Buggy [[File:IBB_Buggy_icon.png|x30px]]
 
|Buggy [[File:IBB_Buggy_icon.png|x30px]]
|[[File:IBB_mDesigner_ColorLED_Set_Color_NoLabelsa.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]]
+
|[[File:IBB_mDesigner_Car_Block_Turn_Speed_Duration_NoLabels.png|x50px|link=Buggy_Base_(use_with_mDesigner)#Car_-_Turn]] [[File:Info_icon.png|24px|link=Buggy_Base_(use_with_mDesigner)#Car_-_Turn]]
 
|}
 
|}
  
Line 135: Line 134:
 
|}
 
|}
  
'''Description:''' [[how to activate blocks|When activated]], Buggy Base will turn left at max speed for 3 seconds.
+
'''Description:''' [[how to activate blocks|When activated]], Buggy Base will turn left at max speed (255) for 3 seconds, then stop automatically.
  
 
==Example 4: Zig-zagging==
 
==Example 4: Zig-zagging==
 
{| class="wikitable" style="background-color:#FEF9E7;"
 
{| class="wikitable" style="background-color:#FEF9E7;"
|'''Note:''' this example is can be performed in '''online''' or '''offline mode'''.<br>
+
|'''Note:''' this example is performed in '''offline mode''' [[File:Info_icon.png|24px|link=no_link]].<br>
If you plan to use '''online''' mode and previously used '''offline''' mode, [[please follow the instructions to reset back to "online mode".]]
 
 
|}
 
|}
 
 
{|
 
{|
  
Line 153: Line 150:
 
|bgcolor=FEC254|Events
 
|bgcolor=FEC254|Events
 
|[[File:MDesigner_When_Click_Green_Flag_block_new.png|x50px]] [[File:Info_icon.png|24px|link=block_reference]]
 
|[[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_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_NoLabelsa.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]]
+
|[[File:IBB_mDesigner_Car_Block_Turn_Speed_Duration_NoLabels.png|x50px|link=Buggy_Base_(use_with_mDesigner)#Car_-_Turn]] [[File:Info_icon.png|24px|link=Buggy_Base_(use_with_mDesigner)#Car_-_Turn]]
 
|}
 
|}
  
Line 168: Line 169:
 
|}
 
|}
  
'''Description:''' [[how to activate blocks|When activated]], Buggy Base will turn left at half speed (127) for 2 seconds, then turn right at half speed (127) for 2 seconds. Then repeat. Which produces a zig-zagging motion.
+
'''Description:''' [[how to activate blocks|When activated]], Buggy Base will repeatedly turn left at half speed (127) for 2 seconds, then turn right at half speed (127) for 2 seconds. This produces a zig-zagging motion.
 
 
=Motors=
 
'''Motor''' blocks are blocks which controls the motors on Buggy Base directly. This gives the user the ability to fine tune the behavior of the motors. The motors are referenced as Motor "A" or "B" depending on the side it resides. These blocks can set the movement direction of the motors ('''Motor - Set Speed''' block) or brake / stop the motors ('''Motor - Stop''' block).
 
==Block: Set Speed==
 
The motors speed and direction can be controlled with the '''Motor - Set Speed''' block.
 
 
 
{| class="wikitable"
 
|
 
{| class="wikitable" style="background-color:#FEF9E7;"
 
|'''Note:''' This block is '''NOT''' holding. Which means once the motor's speed is set, then the program will go to the next block immediately. The motor will continue to run.
 
|}
 
'''Function:''' This block sets the speed of the selected motor.
 
 
 
:[[File:IBB mDesigner Motor Block Set Speed.png]]
 
 
 
:*'''Motor''' - select motor (either '''A''', '''B''', or '''AB''' (both)).
 
 
 
:*'''Speed''' - rate to set the selected '''Motor'''. A value between -255 and 255. Negative values will spin the motor in reverse.
 
::*0 being off
 
::*127 being half speed forward.
 
::*255 being full speed forward
 
::*-255 being full speed backward
 
::*-127 being half speed backward
 
|}
 
 
 
==Block: Stop==
 
The motors can be stopped with the '''Motor - Stop''' block.
 
 
 
{| class="wikitable"
 
|
 
'''Function:''' This block stops the selected motor.
 
 
 
:[[File:IBB mDesigner Motor Block Stop.png]]
 
 
 
:*'''Motor''' - select motor to stop (either '''A''', '''B''', or '''AB''' (both)).
 
|}
 

Latest revision as of 19:40, 30 October 2018

Car

Car blocks are blocks which controls both of the motors at the same time in order to move the forward / backwards (Car - Move block) or turn left / right (Car - Turn block). These are convenience functions designed to be "general purpose". Motors can be controlled directly with the Motor blocks. See section #Motors.

Block: Move

The Car's movement direction can be controlled using the Car - Move block.

Note: This block is holding. Which means the movement time (as set by Duration) must complete before the program goes to the next block in the script.

Function: This blocks controls the Buggy Base to move either forward or backwards at a certain speed for a specified duration.

IBB mDesigner Car Block Direction Speed Duration.png
  • Direction - direction to move. Either forward or backward.
  • Speed - rate of the motors when moving. A value between 0 and 255. 0 being off, 255 being full speed, and 127 being half speed.
  • Duration - amount of time (in seconds) to move.

Example 1: Set move direction of Buggy Base

Note: this example is performed in offline mode Info icon.png.
Blocks Used
Block Category Blocks
Events MDesigner When Click Green Flag block new.png Info icon.png
Buggy IBB Buggy icon.png IBB mDesigner Car Block Direction Speed Duration NoLabels.png Info icon.png
Example

IBB mDesigner Car Movement Example1.png

Description: When activated, Buggy Base will move forward at max speed (255) for 3 seconds.

Example 2: Move forward, then backwards

Note: this example is performed in offline mode Info icon.png.
Blocks Used
Block Category Blocks
Events MDesigner When Click Green Flag block new.png Info icon.png
Control

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

Buggy IBB Buggy icon.png IBB mDesigner Car Block Direction Speed Duration NoLabels.png Info icon.png
Example

IBB mDesigner Car Movement Example2.png

Description: When activated, Buggy Base will repeatedly move forward at half speed (127) for 2 seconds, then move backwards at half speed (127) for 2 seconds.

Block: Turn

The Car can be set to turn using the Car - Turn block.

Note: This block is holding. Which means the movement time (as set by Duration) must complete before the program goes to the next block in the script.

Function: This blocks controls the Buggy Base to turn either right or left at a certain speed for a specified duration.

IBB mDesigner Car Block Turn Speed Duration.png
  • Turn Direction - direction to turn. Either left or right.
  • Speed - rate of the motors when turning. A value between 0 and 255. 0 being off, 255 being full speed, and 127 being half speed.

Example 3: Turning left

Note: this example is performed in offline mode Info icon.png.
Blocks Used
Block Category Blocks
Events MDesigner When Click Green Flag block new.png Info icon.png
Buggy IBB Buggy icon.png IBB mDesigner Car Block Turn Speed Duration NoLabels.png Info icon.png
Example

IBB mDesigner Car Movement Example3.png

Description: When activated, Buggy Base will turn left at max speed (255) for 3 seconds, then stop automatically.

Example 4: Zig-zagging

Note: this example is performed in offline mode Info icon.png.
Blocks Used
Block Category Blocks
Events MDesigner When Click Green Flag block new.png Info icon.png
Control

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

Buggy IBB Buggy icon.png IBB mDesigner Car Block Turn Speed Duration NoLabels.png Info icon.png
Example

IBB mDesigner Car Movement Example4.png

Description: When activated, Buggy Base will repeatedly turn left at half speed (127) for 2 seconds, then turn right at half speed (127) for 2 seconds. This produces a zig-zagging motion.