Difference between revisions of "Buggy Base (use with mDesigner)"
(→Buzzer - Off) |
|||
(59 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
*Motor driver | *Motor driver | ||
*2 Motors | *2 Motors | ||
− | *2 | + | *2 Color Detectors |
*2 Color LEDs | *2 Color LEDs | ||
*Buzzer | *Buzzer | ||
Line 8: | Line 8: | ||
The above components are not controlled directly (i.e. via pins). Rather there is an embedded micro-controller which controls those components. The embedded micro-controller can be communicated via serial communication. | The above components are not controlled directly (i.e. via pins). Rather there is an embedded micro-controller which controls those components. The embedded micro-controller can be communicated via serial communication. | ||
− | Buggy Base was developed to a line-detecting vehicle | + | Buggy Base was developed to be a line-detecting vehicle base, but can be re-purposed for other uses such as a walking robot or climbing robot (as shown in the Itty Bitty Buggy projects). |
=Compatible Pins= | =Compatible Pins= | ||
The Buggy Base is controllable over serial communication. When using mDesigner, the serial pins used are '''Serial1''', which are pins 2/3 on a mCenter+ (Core+) module. | The Buggy Base is controllable over serial communication. When using mDesigner, the serial pins used are '''Serial1''', which are pins 2/3 on a mCenter+ (Core+) module. | ||
=Car - Move= | =Car - Move= | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''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. | ||
+ | |} | ||
+ | This blocks controls the Buggy Base to move either forward or backwards at a certain speed for a specified duration. | ||
+ | |||
+ | :[[File: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. | ||
=Car - Turn= | =Car - Turn= | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''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. | ||
+ | |} | ||
+ | This blocks controls the Buggy Base to turn either right or left at a certain speed for a specified duration. | ||
+ | |||
+ | :[[File: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. | ||
=Motor - Set Speed= | =Motor - Set Speed= | ||
+ | {| 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. | ||
+ | |} | ||
+ | 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 | ||
=Motor - Stop= | =Motor - Stop= | ||
+ | This block stops the selected motor. | ||
+ | |||
+ | :[[File:IBB mDesigner Motor Block Stop.png]] | ||
+ | |||
+ | :*'''Motor''' - select motor to stop (either '''A''', '''B''', or '''AB''' (both)). | ||
=ColorLED - Set Color= | =ColorLED - Set Color= | ||
+ | This block sets the selected ColorLED to the chosen color. | ||
+ | |||
+ | :[[File:IBB mDesigner ColorLED Set Color.png]] | ||
+ | |||
+ | :*'''ColorLED''' - select ColorLED to set color for (either '''A''' or '''B'''). | ||
+ | |||
+ | :*'''Color''' - color to set selected '''ColorLED''' to. | ||
=Car - Color Trace= | =Car - Color Trace= | ||
+ | This block controls the Buggy Base to follow (trace) along the chosen color line. | ||
+ | |||
+ | :[[File:IBB mDesigner Car Block Go Along Color.png]] | ||
+ | |||
+ | :*'''Color''' - color of the line to trace (either '''red''', '''green''', '''blue''' or '''black'''). | ||
+ | |||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''Note:''' This block does one '''adjustment''' when it is called. This means this block has to be constantly called in order to make frequent adjustments to stay on the line. | ||
+ | |} | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''Note:''' This block assumes that the color line is against a white background. (For example, a color line drawn on a white piece of paper.) Therefore, there may be issues when using it against a non-white background. | ||
+ | |} | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''Note:''' The speed of tracing cannot be set. | ||
+ | |} | ||
=Car - Stop Trace= | =Car - Stop Trace= | ||
+ | This block stops the Buggy Base following the line (tracing). | ||
+ | |||
+ | :[[File:IBB_mDesigner_Car_Block_Stop_Trace.png]] | ||
+ | |||
+ | =Color Detector - Detect Color= | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''Note:''' This block approximates the color detected. Therefore, closely related colors may be register as being detected. An example, "orange" registers as "red". | ||
+ | |} | ||
+ | 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'''. | |
=Buzzer - Play Note= | =Buzzer - Play Note= | ||
+ | This block controls the Buzzer to play the selected note for the specified duration. | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''Note:''' If the duration (seconds) is set (not 0) this block is holding. Which means the note must complete playing before the program goes to the next block in the script. | ||
+ | |} | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''Note:''' As of mDesigner v1.6: | ||
+ | *In "online mode" this block accepts whole and decimal numbers. | ||
+ | *In "offline mode" this block only accepts WHOLE numbers. Decimal numbers will be rounded down. | ||
+ | |} | ||
+ | |||
+ | :[[File:IBB mDesigner Buzzer Block Play Note.png]] | ||
+ | |||
+ | :*'''Note''' - select note to play. | ||
+ | |||
+ | :*'''Duration''' - time in seconds to play the selected note. | ||
=Buzzer - Play Song= | =Buzzer - Play Song= | ||
+ | This block controls the Buzzer to play the selected song. | ||
+ | {| class="wikitable" style="background-color:#FF0000; color:#FFFFFF" | ||
+ | |'''Note:''' This block's behavior is '''DIFFERENT''' between online and offline mode! See [[Itty_Bitty_Buggy:_Buzzer_Tutorial_(mDesigner)#Block:_Play_Song|'''Buzzer - Play Song block Tutorial''']]. | ||
+ | |} | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''Note:''' As of mDesigner v1.6: | ||
+ | *In "online mode" this block is holding. Which means the song must complete playing before the program goes to the next block in the script. | ||
+ | *In "offline mode" this block must be constantly called in order to play each note of the song. A '''Forever''' or '''Repeat''' block should be used. | ||
+ | |} | ||
+ | :[[File:IBB mDesigner Buzzer Block Play Song.png]] | ||
+ | |||
+ | :*'''Song''' - selected song to play. | ||
=Buzzer - Off= | =Buzzer - Off= | ||
+ | {| class="wikitable" style="background-color:#FEF9E7;" | ||
+ | |'''Note:''' As of mDesigner v1.6, this block has no intended purpose because the '''Buzzer - Play Note''' and '''Buzzer - Play Song''' blocks will stop automatically based on the duration.<br>It is only useful in certain situations such as demonstrated in '''[[Itty_Bitty_Buggy:_Buzzer_Tutorial_(mDesigner)#Example 3b: Play a song with Buzzer (Offline Mode)]]'''. | ||
+ | |} | ||
+ | This block controls the Buzzer to stop producing sound. | ||
+ | |||
+ | :[[File:IBB_mDesigner_Buzzer_Block_Off.png]] | ||
+ | |||
+ | =Color Detector - Read Color= | ||
+ | This block reads and returns the raw value from the color detector while having the corresponding ColorLED set to a specific color. | ||
+ | |||
+ | :[[File:IBB_mDesigner_LineFinderLED_Block_Read_Color.png]] | ||
+ | |||
+ | :*'''Sensor''' - sensor to read raw value from (either '''A''' or '''B'''). | ||
+ | |||
+ | :*'''Color''' - turn on the corresponding ColorLED to the selected color (either '''red''', '''green''', '''blue''' or '''OFF'''). | ||
− | = | + | {| class="wikitable" style="background-color:#FEF9E7;" |
+ | |'''Note:''' Turning on the corresponding paired ColorLED can help improve the consistency of the raw data readings. | ||
+ | ColorLED "A" and Color Detector "A" are on the same side. Similarly with ColorLED "B" and Color Detector "B". | ||
+ | |} |
Latest revision as of 23:50, 1 November 2018
The Buggy Base found in the Itty Bitty Buggy kit is a unique piece of hardware. It contains the following:
- Motor driver
- 2 Motors
- 2 Color Detectors
- 2 Color LEDs
- Buzzer
The above components are not controlled directly (i.e. via pins). Rather there is an embedded micro-controller which controls those components. The embedded micro-controller can be communicated via serial communication.
Buggy Base was developed to be a line-detecting vehicle base, but can be re-purposed for other uses such as a walking robot or climbing robot (as shown in the Itty Bitty Buggy projects).
Contents
Compatible Pins
The Buggy Base is controllable over serial communication. When using mDesigner, the serial pins used are Serial1, which are pins 2/3 on a mCenter+ (Core+) module.
Car - Move
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. |
This blocks controls the Buggy Base to move either forward or backwards at a certain speed for a specified duration.
- 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.
Car - Turn
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. |
This blocks controls the Buggy Base to turn either right or left at a certain speed for a specified duration.
- 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.
Motor - Set Speed
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. |
This block sets the speed of the selected motor.
- 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
Motor - Stop
This block stops the selected motor.
- Motor - select motor to stop (either A, B, or AB (both)).
ColorLED - Set Color
This block sets the selected ColorLED to the chosen color.
- ColorLED - select ColorLED to set color for (either A or B).
- Color - color to set selected ColorLED to.
Car - Color Trace
This block controls the Buggy Base to follow (trace) along the chosen color line.
- Color - color of the line to trace (either red, green, blue or black).
Note: This block does one adjustment when it is called. This means this block has to be constantly called in order to make frequent adjustments to stay on the line. |
Note: This block assumes that the color line is against a white background. (For example, a color line drawn on a white piece of paper.) Therefore, there may be issues when using it against a non-white background. |
Note: The speed of tracing cannot be set. |
Car - Stop Trace
This block stops the Buggy Base following the line (tracing).
Color Detector - Detect Color
Note: This block approximates the color detected. Therefore, closely related colors may be register as being detected. An example, "orange" registers as "red". |
This block reads and returns either true or false if the selected color detector detects the selected test color.
- 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.
Buzzer - Play Note
This block controls the Buzzer to play the selected note for the specified duration.
Note: If the duration (seconds) is set (not 0) this block is holding. Which means the note must complete playing before the program goes to the next block in the script. |
Note: As of mDesigner v1.6:
|
- Note - select note to play.
- Duration - time in seconds to play the selected note.
Buzzer - Play Song
This block controls the Buzzer to play the selected song.
Note: This block's behavior is DIFFERENT between online and offline mode! See Buzzer - Play Song block Tutorial. |
Note: As of mDesigner v1.6:
|
- Song - selected song to play.
Buzzer - Off
Note: As of mDesigner v1.6, this block has no intended purpose because the Buzzer - Play Note and Buzzer - Play Song blocks will stop automatically based on the duration. It is only useful in certain situations such as demonstrated in Itty_Bitty_Buggy:_Buzzer_Tutorial_(mDesigner)#Example 3b: Play a song with Buzzer (Offline Mode). |
This block controls the Buzzer to stop producing sound.
Color Detector - Read Color
This block reads and returns the raw value from the color detector while having the corresponding ColorLED set to a specific color.
- Sensor - sensor to read raw value from (either A or B).
- Color - turn on the corresponding ColorLED to the selected color (either red, green, blue or OFF).
Note: Turning on the corresponding paired ColorLED can help improve the consistency of the raw data readings.
ColorLED "A" and Color Detector "A" are on the same side. Similarly with ColorLED "B" and Color Detector "B". |