I recently made the leap from using the BS2 microcontroller and BOE development board to the Basic Atom Pro 28 with Bot Board II. While I have been tremendously impressed with the extra processing power and speed of the Basic Atom Pro, the transition hasn’t been entirely painless and I’m still unable to accomplish certain tasks on the new platform. Right now push-button input is giving me the most trouble.
I’ve wired a momentary normally open switch to one of the Bot Board II inputs with signal and ground tied together on one side of the switch and the 5V input on the other. This is how I’ve been using buttons on the Parallax BOE development board. At the moment I’m using the following excerpt of code in my program:
[code]trigger CON 4 ’ Define I/O pin
’ ----- Variables ]----------------------------------------------------------
delay VAR Byte
rate VAR Byte
count1 VAR Byte
’ Specify trigger button operation
delay = 0
rate = 0
input trigger
’ ----- Main Routine ]-------------------------------------------------------
main: ’ Begin main routine.
'button trigger,0,delay,rate,count1,1,GET_PULSES
goto SERVO_PULSES
goto main[/code]
Currently this code does not register a button press and in fact causes the entire board to go dead and reset when I activate the switch. I thought that my switch and wiring method may be the problem so I tried the same code using ButA as the trigger:
[code]butA var bit
BUTTON_DOWN con 0
BUTTON_UP con 1
’ ----- Initialization ]-----------------------------------------------------
butA = 0
’ ----- Main Routine ]-------------------------------------------------------
main: ’ Begin main routine.
if (trigger = button_up) then
goto get_pulses
else
goto SERVO_PULSES
endif
goto main[/code]
Again, no luck. Am I missing something important? I have my jumpers configured exactly as shown in the Bot Board II tutorial. Does button operation require use of VS and VL combined rather than VS alone? Is there something wrong with my BBII? Any assistance would be appreciated.
Dan Toborowski
President
Central Illinois Robotics Club
circ.mtco.com