count to determine boe bot action
maybe this cant be done the way i want it to. or maybe it is the long way of doing it. but here goes.
I have done all the basic programs in the Robotics with the Boe-Bot book ver 3.0.
what i want to do is set the boe-bot up so that all the basic programs are all loaded verses having to carry my laptop with me to display the diff functions. The idea is to have a script at the beggening that will count how many times the tactical whisker is tapped. then have the boe-bot use the tap count to start a sub routine. i have used a couple of diff count methods but i have yet to over come the contact bounce.
here is what i think is my best script. i would much rather have a percise count so i can have many more options.
I have done all the basic programs in the Robotics with the Boe-Bot book ver 3.0.
what i want to do is set the boe-bot up so that all the basic programs are all loaded verses having to carry my laptop with me to display the diff functions. The idea is to have a script at the beggening that will count how many times the tactical whisker is tapped. then have the boe-bot use the tap count to start a sub routine. i have used a couple of diff count methods but i have yet to over come the contact bounce.
here is what i think is my best script. i would much rather have a percise count so i can have many more options.

Comments
' ' {$STAMP BS2} ' {$PBASIC 2.5} ' count number of tapps on the tacktical whisker then proform action in ' accordance with count outcome selection var word count 5,5000,selection pause 20 IF selection =< 50 then gosub programe_1 else IF selection > 50 then gosub programe_2 endif endif program_1: debug cr, ? selection debug cr, "program 1" end program_2: debug cr, ? selecton debug cr, "program 2" end' BUTTON.BS2 ' Connect an active-low circuit to pin P5 and p7 of the BS2. When you press the ' button p5 , the DEBUG screen will display a count of how many times you pushed the button. ' the p7 BUTTON will execute the program corrasponding to the amount of times you pushed the ' button. I used the whiskers as the buttons ' {$STAMP BS2} ' {$PBASIC 2.5} Btn PIN 5 Btn2 PIN 7 btnWrk VAR Byte btn2Wrk VAR Byte counter VAR Word Main: PAUSE 50 BUTTON Btn, 5, 255, 20, btnWrk, 0, No_Press counter = counter + 1 DEBUG CR, ? counter No_Press: PAUSE 50 BUTTON Btn2, 7, 255, 20, btn2Wrk, 0, goto_main IF counter = 1 THEN GOTO main ENDIF DEBUG CR, "this should start program 1" GOTO program_1 goto_main: GOTO Main program_1: DEBUG CR, ? counter DEBUG CR, "if counter printed then this might work" IF counter = 1 THEN GOTO main IF counter = 2 THEN GOTO tactile_whiskers IF counter = 3 THEN GOTO phototransistor IF counter = 4 THEN GOTO infra_red IF counter => 5 THEN GOTO TO_many_button_pushes tactile_whiskers: DEBUG CR, "tactile_whiskers code would exacute" END phototransistor: DEBUG CR, "phototransistor code would exacute" END infra_red: DEBUG CR, "infra_red code would exacute" END TO_many_button_pushes: DEBUG CR, "you pushed the button more times than you have programs" ENDIf you're already using the Boebot's IR proximity sensors, you have all the hardware you need. You can use those same sensors to receive IR signals from a TV remote control. It's all in the Boebot book.