Datasheet

Page 76ยท Applied Robotics with the SumoBot
9. What is the decimal number for hexadecimal-E?
10. What PBASIC operator allows you to examine individual bits in larger
variables?
11. What does the
IF...THEN statement in the Reset subroutine do if the temp
variable is even?
12. What variable stores the binary 1/0 values sensed by
pbSense?
13. In PushbuttonMode.bs2, what how is temp used?
14. Why are PBASIC programs separated into sections?
15. What's the advantage in using the optional
Symbol name for all DATA directives?
Exercises
1. Write a DATA directive that stores the prime numbers between 0 and 100. Write
a routine to display all the values.
2. Calculate the decimal equivalent of hexadecimal-3FF.
3. Write a routine that displays each bit in a byte variable.
4. Modify the S
ELECT...CASE statement in PushbuttonMode.bs2 so that you can
select forward travel in different distances with each mode.
5. Write a line of code that sets aside 100 consecutive EEPROM bytes as
undefended data.
6. Write a routine that captures two values from the Debug Terminal's Transmit
windowpane and compares them.
Projects
1. Use the techniques from Activity #5 to make an adjustable version of
Forward100Pulses.bs2 from Chapter 1, Activity #1. Make it so you can select
between 6 different distances ranging from 100 to 500 in steps of 100 and
infinite loop mode.
2. Modify the
Reset subroutine so that you can use the Reset button to select from
four different modes of operation. Test this routine in a modified version of
Pushbuttonmode.bs2 that does not require the pushbutton.