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

From Microduino Wiki
Jump to: navigation, search
(Example 2: Spinning Buggy Base)
(Example 1: Repeatedly turn on and off Motor "A")
 
(10 intermediate revisions by the same user not shown)
Line 25: Line 25:
 
==Example 1: Turn Motor "A" on to full speed==
 
==Example 1: Turn Motor "A" on to full speed==
 
{| 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 can be performed in '''online''' or '''offline mode'''.<br>
 
If you plan to use '''online''' mode and previously used '''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"'''.]]
 
If you plan to use '''online''' mode and previously used '''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 41: Line 41:
 
|-
 
|-
 
|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_Motor_Block_Set_Speed_NoLabels.png|x50px|link=Buggy_Base_(use_with_mDesigner)#Motor_-_Set_Speed]] [[File:Info_icon.png|24px|link=Buggy_Base_(use_with_mDesigner)#Motor_-_Set_Speed]]
 
|}
 
|}
  
Line 70: Line 70:
 
|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_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]]
 
|-
 
|-
 
|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_Motor_Block_Set_Speed_NoLabels.png|x50px|link=Buggy_Base_(use_with_mDesigner)#Motor_-_Set_Speed]] [[File:Info_icon.png|24px|link=Buggy_Base_(use_with_mDesigner)#Motor_-_Set_Speed]]
 
|}
 
|}
  
Line 103: Line 108:
 
:*'''Motor''' - select motor to stop (either '''A''', '''B''', or '''AB''' (both)).
 
:*'''Motor''' - select motor to stop (either '''A''', '''B''', or '''AB''' (both)).
 
|}
 
|}
 +
==Example 1: Repeatedly turn on and off Motor "A"==
 +
{| class="wikitable" style="background-color:#FEF9E7;"
 +
|'''Note:''' this example can be performed in '''online''' or '''offline mode'''.<br>
 +
If you plan to use '''online''' mode and previously used '''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"'''.]]
 +
|}
 +
 +
{|
 +
 +
|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><br>
 +
[[File:mDesigner_v1.6_Forever_block.png|x75px]] [[File:Info_icon.png|24px|link=block_reference]]
 +
|-
 +
|Buggy [[File:IBB_Buggy_icon.png|x30px]]
 +
|
 +
[[File:IBB_mDesigner_Motor_Block_Set_Speed_NoLabels.png|x50px|link=Buggy_Base_(use_with_mDesigner)#Motor_-_Set_Speed]] [[File:Info_icon.png|24px|link=Buggy_Base_(use_with_mDesigner)#Motor_-_Set_Speed]]<br><br>
 +
[[File:IBB_mDesigner_Motor_Block_Stop_NoLabels.png|x50px|link=Buggy_Base_(use_with_mDesigner)#Motor_-_Stop]] [[File:Info_icon.png|24px|link=Buggy_Base_(use_with_mDesigner)#Motor_-_Stop]]
 +
|}
 +
 +
|style="vertical-align:top;"|
 +
{| class="wikitable"
 +
|+Example
 +
|-
 +
|style="padding:50px;"|
 +
[[File:IBB_mDesigner_Motor_Example3.png]]
 +
|}
 +
 +
|}
 +
 +
'''Description:''' [[how to activate blocks|When activated]], Motor "A" will repeatedly turn on and off with a 1 second delay in between.

Latest revision as of 22:42, 1 November 2018

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.

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.

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

Example 1: Turn Motor "A" on to full speed

Note: this example can be performed in online or offline mode.

If you plan to use online mode and previously used 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 Motor Block Set Speed NoLabels.png Info icon.png
Example

IBB mDesigner Motor Example1.png

Description: When activated, Motor "A" will turn on at full speed (255).

Example 2: Spinning 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
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 Motor Block Set Speed NoLabels.png Info icon.png
Example

IBB mDesigner Motor Example2.png

Description: When activated, the motors on Buggy Base will turn in opposite directions, which causes a spinning motion. As described below.

The following will loop forever:

  • Motor "A" (speed 255) and "Motor "B" (speed -255) are set to spin in opposite directions. This causes the Buggy Base to spin clockwise.
  • 3 second pause.
  • Motor "A" (speed -255) and "Motor "B" (255) are set to spin in opposite directions. This causes the Buggy Base to spin counter-clockwise.
  • 3 second pause.

Block: Stop

The motors can be stopped with the Motor - Stop block.

Function: This block stops the selected motor.

IBB mDesigner Motor Block Stop.png
  • Motor - select motor to stop (either A, B, or AB (both)).

Example 1: Repeatedly turn on and off Motor "A"

Note: this example can be performed in online or offline mode.

If you plan to use online mode and previously used 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 Motor Block Set Speed NoLabels.png Info icon.png

IBB mDesigner Motor Block Stop NoLabels.png Info icon.png

Example

IBB mDesigner Motor Example3.png

Description: When activated, Motor "A" will repeatedly turn on and off with a 1 second delay in between.