EasyManua.ls Logo

Parallax Boe-Bot - Page 53

Parallax Boe-Bot
360 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 1: Your Boe-Bot’s Brain · Page 39
Solutions
Q1. The BASIC Stamp 2 microcontroller module.
Q2. Binary numbers.
Q3. The Debug Terminal.
Q4.
DEBUG and END.
E1.
DEBUG – This command is used to send a message from the BASIC Stamp to the
PC. The information is displayed on the Debug Terminal.
END – This command is used to terminate a PBASIC program and put the BASIC
Stamp module into low-power mode.
E2. The asterisk multiplies the two operands 7 and 11, resulting in a product of 77.
The asterisk is the multiply operator.
E3. To fix the problem, add a carriage return, the
CR control character.
DEBUG DEC 7 * 11
DEBUG CR, DEC 7 + 11
P1. Here is a program to display a solution to the math problem:
' Robotics with the Boe-Bot - HelloBoeBotCh01Project01.bs2
' Adds together 4 numbers with DEBUG
'{$STAMP BS2}
'{$PBASIC 2.5}
DEBUG "What's 1+2+3+4?"
DEBUG CR, "The answer is: "
DEBUG DEC 1+2+3+4
END
P2. Prediction: It will print the character "M". This program tests this prediction:
' Robotics with the Boe-Bot - HelloBoeBotCh01Project02.bs2
' Prints ASCII 7 * 11
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG 7 * 11
END

Table of Contents

Other manuals for Parallax Boe-Bot