stamp_demon
05-21-2005, 12:02 PM
Hello, I have been trying to use the memsic 2125 on my boe bot. The idea was this. If the bot rode up onto something high on the left side, it would back up nad turn left, and the same for the opisit side, but turning right of course. So I wanted to start with some real basic values to just try it out at first. I ran the code found in the stamp in class pdh. Got a basic value for x and y on level ground, then I telted it to each side and got values for x and y. High on left, and high on right.
· Using the bs2px I got the following values..
··· on level ground x = 6060, y = 6060 aprox..
··· high on the left x=·5940 aprox, y= 6250
··· high on the right side x= 5905 y = 5750· (these are aprox values true within +/- 5 to 10).
· So I wrote some real basic code that went something like this...
·· x var word
·· y var word
··
·· x_y:
·· pulsin 6, 1, x
·· pulsin 7, 1, y
·· if (x < 5905 and y < 5750) then··· ' high on right..
·· gosub back_up
·· gosub left_turn
·· elseif (x <·5940 and y < 6250) then·· ' high on left
·· gosub back_up
·· gosub right_turn
···else
·· gosub forward
·· pause 20··
·· endif
·· return
·· Keep in mide that this is just one routine within the prog.... called from main.·· Anyway my propblem is this. when the bot is high on the righ it works fine, but wont repond correct when high on the left... I have experimented with different values... with the same results... At the moment I am at a loss... If anyone can help , I would greatly appriciate it... thank you _Duane
·
·
· Using the bs2px I got the following values..
··· on level ground x = 6060, y = 6060 aprox..
··· high on the left x=·5940 aprox, y= 6250
··· high on the right side x= 5905 y = 5750· (these are aprox values true within +/- 5 to 10).
· So I wrote some real basic code that went something like this...
·· x var word
·· y var word
··
·· x_y:
·· pulsin 6, 1, x
·· pulsin 7, 1, y
·· if (x < 5905 and y < 5750) then··· ' high on right..
·· gosub back_up
·· gosub left_turn
·· elseif (x <·5940 and y < 6250) then·· ' high on left
·· gosub back_up
·· gosub right_turn
···else
·· gosub forward
·· pause 20··
·· endif
·· return
·· Keep in mide that this is just one routine within the prog.... called from main.·· Anyway my propblem is this. when the bot is high on the righ it works fine, but wont repond correct when high on the left... I have experimented with different values... with the same results... At the moment I am at a loss... If anyone can help , I would greatly appriciate it... thank you _Duane
·
·