Bs2........help......
Phills03
Posts: 2
I have a BS2 HomeWork Board Rev A, all that I want to do is build a Boe-Bot. The code seems to be written fine, but when the board gets to the second counter (counter2), it only gets a count of one then the program loops back to counter1. Here's my code:
' {$STAMP BS2}
' {$PBASIC 2.5}
counter VAR Word
counter2 VAR Word
FOR counter = 1 TO 50
DEBUG ? counter
PULSOUT 13, 550
PAUSE 20
NEXT
FOR counter2 = 1 TO 50
DEBUG ? counter2
PULSOUT 13, 800
PAUSE 20
NEXT
END
Here is a link to what the Debug screen looks like when the problem occurs: http://i739.photobucket.com/albums/xx38/phills03dodge/codeerror.jpg I have contacted Parallax support with no success. Here's the kicker, this is the second board that this problem has occured on. The first board (555-28188-RT) I took to my robotics professor and she said that the board was possibly bad, so I returned it to RadioShack. Now the second board does the exact same thing. I'm using Parallax continuous rotation servos and a new 9V battery. A pic of how it's wired up is here: http://i739.photobucket.com/albums/xx38/phills03dodge/DSCF10551.jpg. I realize that the positive leads are connected to the Vin pin. They have since been moved to the Vdd pins. These servos have been tested on a Board of Education board and they respond to the code fine. When other servos are connected to this HomeWork the same problem occurs. It's safe to say that it isn't a servo problem, but why would two different boards have this problem? I tried the Stamp Editor on two different computers (win7 and winXP) with the same result. I'm completely lost here, any suggestions at all would be greatly appreciated.
' {$STAMP BS2}
' {$PBASIC 2.5}
counter VAR Word
counter2 VAR Word
FOR counter = 1 TO 50
DEBUG ? counter
PULSOUT 13, 550
PAUSE 20
NEXT
FOR counter2 = 1 TO 50
DEBUG ? counter2
PULSOUT 13, 800
PAUSE 20
NEXT
END
Here is a link to what the Debug screen looks like when the problem occurs: http://i739.photobucket.com/albums/xx38/phills03dodge/codeerror.jpg I have contacted Parallax support with no success. Here's the kicker, this is the second board that this problem has occured on. The first board (555-28188-RT) I took to my robotics professor and she said that the board was possibly bad, so I returned it to RadioShack. Now the second board does the exact same thing. I'm using Parallax continuous rotation servos and a new 9V battery. A pic of how it's wired up is here: http://i739.photobucket.com/albums/xx38/phills03dodge/DSCF10551.jpg. I realize that the positive leads are connected to the Vin pin. They have since been moved to the Vdd pins. These servos have been tested on a Board of Education board and they respond to the code fine. When other servos are connected to this HomeWork the same problem occurs. It's safe to say that it isn't a servo problem, but why would two different boards have this problem? I tried the Stamp Editor on two different computers (win7 and winXP) with the same result. I'm completely lost here, any suggestions at all would be greatly appreciated.
Comments
I know you have a home work board, but if you read this document http://www.parallax.com/Portals/0/Downloads/docs/prod/edu/Servos-BOERevAB-HWBRevB-v1.0.pdf for the older board of education they use a capacitor to prevent this. It might be worth a try. If you use 4 AA batteries for power that might also do the trick. Worst case scenario you would need to use a 9v battery for the home work board and 4 AA's for the servo. Their grounds would need to be connected.
I have ran your code and it worked just fine on my BS2 Super Carrier board with no servos attached. Here is a testing suggestion. Try unplugging the servos from the board and running the code and see if your code works. I suspect that the servo running in one direction and then switching to the other is causing the board to reset. Thus starting the program over. 9v batteries are known for this when trying to run servos because they don't have a lot of capacity and servos can draw a lot of current. If the code doesn't run with the servos unplugged, replace the battery with a new one and try running the code again with the servos unplugged.
Tony
EDIT: Looks like Martin H beat me to a response. Posted While I was responding.
Edit2: Just tested setup with servo plugged in. Worked OK. I believe you will find the battery to be the issue.