Itty Bitty Buggy: Car Movement Tutorial (mDesigner)

From Microduino Wiki
Revision as of 19:40, 30 October 2018 by Sonny (talk | contribs) (Example 4: Zig-zagging)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.