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.

im pretty green at

im pretty green at programming and robotics, so my answer might not be the best.  

I think it depends heavily on your robot, what sort of system you have for movement.  The code for running continious rotation servos would be very differnt from interfacing with a motor and an H bridge.

The other consideration is how do you know when you have turned 90 degrees? do you have encoders to track wheel movement?  or a compass or gyro to get rotational movement from? Its all very dependant on your setup, and what you have.  I might be fairly new to robotics and coding but I know enough to tell you thats not enough information to give an answer, so remember when you ask questions to post as much info about what you are doing and how you have it set up as possible, this helps people give you answers that are relavant to what you are doing and wwhat you want to hear.  I dont think that within reason there is a such thing as to much information.

post back with what you are doing and what you have setup and I (maybe) or somebody more knowledgeable than myself will probably be able to help you

+1

Excellent response.