Datasheet
Chapter 5: Debugging and Datalogging ยท Page 253
SUMMARY
This chapter introduced three techniques to help find the cause(s) of SumoBot problem
behaviors: (1) LED signals, (2) debugging routines, and (3) datalogging a sumo round.
Conditional compiler directives were applied to all these techniques, so that you can
change one or two values at the beginning of the program to either include or exclude
your conditional LED/debugging/datalogging code from the program.
Questions
1. What are the five steps in the Scientific Method?
2. How can one line of code signal the occurrence of an event with an LED?
3. What are the advantages of turning and leaving the LED on when an event
occurs?
4. What is branching?
5. What is conditional compiling?
6. What are some examples of things you can use
#DEFINE to do?
7. What's the difference between
SELECT...CASE and #SELECT...#CASE?
8. Is it possible to put constant declarations and
DATA directives in conditional
compiler directives, or just PBASIC commands?
9. Which two bits of the
sensors variable are available if you want to add sensors?
10. What key features are missing that might prevent you from finding a bug while
the SumoBot is connected to the serial cable displaying information on the
Debug Terminal?
11. What are some examples of changes that had to be made to the conditional
compiler directives in SumoWrestlerWithPlayback.bs2?
12. What's the purpose of the
Playback_Round routine, and under what
circumstances does that code get executed?
13. What role does the
temp variable play in logging data?
14. How does the
temp variable store more than one value in the program
SumoWrestlerWithDatalogMode.bs2?
Exercises
1. Add LED events to the Track_Front_Left_Object subroutine that signal the
start and end of each of its maneuvers.
2. Write conditional compiler directives to add IR interference testing to
SumoWrestlerWithDebugMode.bs2.
3. Calculate how many records you can store with addresses $10 to $24F.