Programming the robot to make a square

Hi, just built my first robot.

How do I program it to go straight 30 seconds make a 90 degree turn go straight another 30 seconds….

Trying to make a square.

I'm using Picaxe to program

 

Thanks.

This is what I have nowlow 5

This is what I have now
low 5 : high 7 : high 4 : Low :6                  
 
pause 10000                                            
low 6 : high 6 : high 7 : Low :4                  
 
pause 10000
 
low 5 : high 7 : high 4 : Low :6
 
pause 10000
 
low 6 : high 6 : high 7 : Low :4
 
 
 
It goes straight for a while then just continues in a tight turn doing a 360 and keeps on turning.
 
Where did I go wrong?

Sorry that was a typo.it

Sorry that was a typo.

it should of been high 4 : low 5 : high 7  :  low 6

Thanks,

I was looking for the “pause” command.

Maybe I could help…

you get wrong on the delayed time of the robot during its steering motion…

for example 

you did let the robot to turn left, then you just put a "delayMicroseconds(10000), so, it keeps on turning left during 10 seconds…thats what made you see that its moving 360 degrees…since you give the robot a lot of time to turn left… 

 

so what you are going to do now is…“Trial and Error”… You need to determine the delay time during its steering motion, which depends on the size of the robot you had… the bigger the size of your bot… the bigger the delayed time and just a vice versa to smaller one, inorder to get into exact 90 degrees…

 

it would be easier if you’re using Continous Rotational Servos… Since you can give different amount of degrees… and no need to determine the delay…

 

Maybe I could help…

you get wrong on the delayed time of the robot during its steering motion…

for example 

you did let the robot to turn left, then you just put a "delayMicroseconds(10000), so, it keeps on turning left during 10 seconds…thats what made you see that its moving 360 degrees…since you give the robot a lot of time to turn left… 

 

so what you are going to do now is…“Trial and Error”… You need to determine the delay time during its steering motion, which depends on the size of the robot you had… the bigger the size of your bot… the bigger the delayed time and just a vice versa to smaller one, inorder to get into exact 90 degrees…

 

it would be easier if you’re using Continous Rotational Servos… Since you can give different amount of degrees… and no need to determine the delay…