Terrapin Resources

Terrapin Logo 4 has been discontinued! Our new Terrapin Logo version is much more powerful and modern; we strongly recommend that you update to our latest release of the Logo programming language.

Blue-Bot Commands

Talk to Blue-Bot.

Terrapin Logo 4.1 can download Logo commands to a Blue-Bot robot. See the Programming Blue-Bot page for details. This page also explains how to connect a Blue-Bot.

Please note that you need Terrapin Logo version 4.1 or higher; older versions do not support the Blue-Bot commands.

BLUEBOT?

Also: BLUEBOTP

Tests if the Blue-Bot drivers are installed.

Syntax

Description

BLUEBOT? reports TRUE if the Bluetooth drivers for Blue-Bot are installed. These drivers install as soon as you connect a Blue-Bot robot via Bluetooth.

The command is available in Terrapin Logo version 4.1 and up.

Example

BLUEBOT? Result: FALSE

BLUEBOT.CLEAR

Clears all commands stored in Blue-Bot’s memory.

Syntax

Description

BLUEBOT.GO CLEARS all commands stored into Blue-Bot. This is equivalent to pressing Blue-Bot’s CLEAR button, which is disabled when a connection is open.

The command is available in Terrapin Logo version 4.1 and up.

BLUEBOT.CLOSE

Closes the Blue-Bot connection.

Syntax

Description

BLUEBOT.CLOSE closes an open connection. After closing the connection, Blue-Bot’s eyes turn white, and its buttons are enabled.

The command is available in Terrapin Logo version 4.1 and up.

BLUEBOT.GO

Executes commands stored in Blue-Bot’s memory.

Syntax

Description

BLUEBOT.GO executes all commands that a previous BLUEBOT.WRITE command has stored into Blue-Bot. This is equivalent to pressing Blue-Bot’s GO button, which is disabled when a connection is open.

The command is available in Terrapin Logo version 4.1 and up.

BLUEBOT.OPEN

Opens the connection to Blue-Bot.

Syntax

Description

The BLUEBOT.OPEN command opens the connection between Terrapin Logo and Blue-Bot. Once the connection is established, Blue-Bot’s eyes turn blue, and Blue-Bot listens to commands. If you turn Blue-Bot off and on again, the connection breaks; you need to re-issue the BLUEBOT.OPEN command to re-connect to Blue-Bot.

Once Blue-Bot is connected to Terrapin Logo, its buttons are disabled. You need to close the connection using the BLUEBOT.CLOSE command to make the buttons work again.

The command is available in Terrapin Logo version 4.1 and up.

BLUEBOT.RUN

Executes Blue-Bot commands.

Syntax

Description

BLUEBOT.RUN transmits a list of commands to Blue-Bot and lets Blue-Bot execute them immediately. Use the BLUEBOT.WRITE and BLUEBOT.GO commands if you want Blue-Bot to repeatedly execute a list of stored commands.

Blue-Bot stores a maximum of up to 200 commands. Please note that a Logo command may consume more than one Blue-Bot command. If you get an error message that your code is too complex, consider using a repeat loop, or fewer movements. A FD 10 command, for example, would store 10 FD commands into Blue-Bot’s memory.

The command is available in Terrapin Logo version 4.1 and up.

Blue-Bot does not understand many commands. The following table provides an overview over all available Logo commands that Blue-Bot understands.

   
FORWARD Blue-Bot moves forward in fixed-size units. A value of 1 does not mean a single pixel as the screen turtle, but one Blue-Bot movement unit, which is about 6 inches (15 cm). If you, for example, use the command FD 2, Blue-Bot will move forward one unit, stop briefly, and then move forward a second unit.
BACK As with the FORWARD command, Blue-Bot moves backwards in the same way that it moves forward. If you use negative values as input to BACK, Blue-Bot moves forward and vice versa.
LEFT Blue-Bot turns left or right in 45-degree increments. Terrapin Logo calculates the amount to turn in as few commands as possible. Therefore, Blue-Bot may make brief stops while turning.
RIGHT The same limitations that are valid for the LEFT command also apply to this command. As with FORWARD and BACK, negative values make Blue-Bot turn in the opposite direction.
WAIT This command corresponds to Blue-Bot’s Pause button. Blue-Bot pauses in units of about two seconds. Therefore, the input to WAIT (which is a millisecond value) should be a multiple of 2000. Terrapin Logo rounds wait times up to the nearest multiple of two seconds.
REPEAT Blue-Bot has a simple built-in repeat feature that lets it execute a list of commands between 1 and 16 times. The REPEAT command cannot be nested.

Example

BLUEBOT.RUN [REPEAT 4 [FD 1 RT 90]]

BLUEBOT.STATUS

Reports status information about Blue-Bot.

Syntax

Description

BLUEBOT.STATUS outputs a three-element list. The first two elements are usually TRUE, but may be FALSE if one of Blue-Bot’s motors is stalled; the third element is the battery level, which is a number between 0 and 1.

The command is available in Terrapin Logo version 4.1 and up.

Example

BLUEBOT.STATUS Result: [TRUE TRUE 0.8]

BLUEBOT.WRITE

Downloads a procedure to Blue-Bot.

Syntax

Description

BLUEBOT.WRITE transmits a procedure to Blue-Bot. Its input is the name of the procedure to transmit. It does not run these commands; use the BLUEBOT.GO command to execute a stored list of commands.

Blue-Bot stores a maximum of up to 200 commands. Please note that a Logo command may consume more than one Blue-Bot command. If you get an error message that your code is too complex, consider using a repeat loop, or fewer movements. A FD 10 command, for example, would store 10 FD commands into Blue-Bot’s memory.

For a list of commands that Blue-Bot understands, see the BLUEBOT.RUN command.

Please note that the procedure must not have any inputs, and it may not contain commands that Blue-Bot does not understand. See the BLUEBOT.RUN command for a list of commands; especially the Blue-Bot version of the FORWARD command is different.

The command is available in Terrapin Logo version 4.1 and up.

Example

TO MY.BLUEBOT REPEAT 4 [FD 1 RT 90] END MY.BLUEBOT defined BLUEBOT.WRITE “MY.BLUEBOT BLUEBOT.GO