' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ' * Lab 06 Program: Testing The Tactile Navigation Whiskers * ' * Written By: NJ Getson * ' * Date Created: 12 Jan 2020 * ' * Last Modified: 02 Aug 2023 * ' * * ' * This simple program will verify that the tactile navigation whiskers * ' * are operating as expected. If an obstacle is detected, the motion of * ' * the whisker will result in it touching the pin header. This breaks * ' * the circuit. The state of the circuit is stored automatically in the * ' * input registers. In this case, the P5 state is stored in IN5 and the * ' * P7 state is stored in IN7. The state is stored as a binary, where a * ' * value = 0 means the circuit is open, and value = 1 means the circuit * ' * is closed. Thus, when state = 0 means the whisker has encountered an * ' * obstacle. * ' * * ' *. This program will report the whisker state to the DEBUG terminal. * ' * The user manually presses the whisker into the pin header to break * ' * the circuit. The loop used is infinite, which is not optimal, but is * ' * acceptable for a program used only for a proof-of-concept test. * ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * '{$STAMP BS2} '{$PBASIC 2.5} ' Set up a table to display the whisker states on the screen DEBUG "WHISKER STATES", CR, "Left Right", CR, "------ ------" ' Set up a LOOP TO continuously check the state of each whisker ' BIN1 = display as binary (1 or 0) ' IN5 = the input register for P5 ' IN7 = the input register for P7 DO DEBUG CRSRXY, 0, 3, "P5 = ", BIN1 IN5, " P7= ", BIN1 IN7 PAUSE 50 LOOP END