Programming help with BoeBot
I'm new at this, so please be gentle....
Stock BoeBot with 2x16 serial LCD and Hitachi HM55B Compass.
I combined a modified Roaming with IR and the Test Calibrated compass program.
Amazing to me it ran..after some syntax error problem fixes.
But what it does now....when the degrees from north displays, the servos stop, when the display goes·blank, the servos start again.· I think it is because the display part of the program is within the do-loop section.· I've tried to move that, but I can't find the spot.· How can I program this so that the forward·pulse continues without pausing for the "degrees" display?
The program is attached (hopefully).
This is driving me carzy....so it must be simple.
This roboticis is a great hobby, has given me some ideas to use at work.
Thanks,
Jeff
PS-Not the BoeBot with the tank treads....from my·other post.
Stock BoeBot with 2x16 serial LCD and Hitachi HM55B Compass.
I combined a modified Roaming with IR and the Test Calibrated compass program.
Amazing to me it ran..after some syntax error problem fixes.
But what it does now....when the degrees from north displays, the servos stop, when the display goes·blank, the servos start again.· I think it is because the display part of the program is within the do-loop section.· I've tried to move that, but I can't find the spot.· How can I program this so that the forward·pulse continues without pausing for the "degrees" display?
The program is attached (hopefully).
This is driving me carzy....so it must be simple.
This roboticis is a great hobby, has given me some ideas to use at work.
Thanks,
Jeff
PS-Not the BoeBot with the tank treads....from my·other post.
Comments
LOOP' Repeat main loop
Forward_Pulse: ' Send a single forward pulse.
FOR pulseCount = 0 TO 20
PULSOUT 13,850
PULSOUT 12,650
PAUSE 20
NEXT
RETURN
Turn_Left: ' Left turn, about 90-degrees.
FOR pulseCount = 0 TO 20
PULSOUT 13, 650
PULSOUT 12, 650
PAUSE 20
NEXT
RETURN
Turn_Right:
FOR pulseCount = 0 TO 20 ' Right turn, about 90-degrees.
PULSOUT 13, 850
PULSOUT 12, 850
PAUSE 20
NEXT
RETURN
Back_Up: ' Back up.
FOR pulseCount = 0 TO 40
PULSOUT 13, 650
PULSOUT 12, 850
PAUSE 20
NEXT
RETURN
LOOP' Repeat main loop
Jeff
1.·Check to see if your batteries are fresh.
2. Try running from an AC supply.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
The beginning of your program presently looks like this:
'
[noparse][[/noparse] Initialization ]
HIGH TX ' setup serial output pin
PAUSE 100 ' allow LCD to initialize
'
[noparse][[/noparse] Main Routine ]
Just after that coding above, and before any other, please add the following line:
DEBUG "Starting"
That message "Starting" should only appear once during any run of the program. If is appears more than once, the Stamp is being RESET. If it is resetting, then you can go on with the debugging procedures to determine why. Without knowing that, you're shooting in the dark.
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Entered the debug "starting" just before the Do.
When the program runs the "starting" only appears once.
Batteries are new and the bot roams all over, but the servos stop only when going forward when the LCD displays the degrees.
So this would allow moving the motors while calculating the degrees.
Servo controller:
http://www.parallax.com/detail.asp?product_id=28023
Post Edited (Derek) : 2/26/2006 9:10:52 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
I think Derek is right, the bot can't turn the servos and display the heading at the same time.
Chris, I did the debug at the begining and at the end of each subroutines and it runs through the program with no problem. The pauses are for the LCD to stay on so that you can read the message displayed. This was a great learning experience!
I moved the code for displaying the heading so that when the bot detects an object it stops, then displays the heading and continues to backup.