It was very hard for me to setup everything till now. Almost had a problem with every step till now but thank god, was able to complete till programming the hardware.
Everything seems to fine now: power, connectivity, hardware but my servos and motors don't work when i run the program.
I have checked my servo position is at 0 only and I run the code accordingly.
Check that you have both motors going forward when you tell them to go forward. Swap wires or modify the HIGH/LOW’s within the code to get them both going the right way
Check your distance sensor to see what values are coming out when an object is say, 10 or 12" away
Be sure you have the “danger” variable set to reflect this value
Check to see that your servo was indeed centered when you installed the distance sensor. If the head is looking hard left but the robot thinks it is centered, it could give you problems
There are of course, a lot of other stuff it could be --but again, you have not given us a whole lot to work with in terms of your question, so this is the best I can think of, I’m afraid.
PWM is Pulse Width Modulation and in this case would be used for speed control of your motors. If you are using the standard Picaxe 28x board (the Start Here board), it is not available to be used.