We have perfected the tunnel vision on the basic atom 28 pin We already have the code to read distance but we need one to get the sonar on our rover to move 360; and scan the distance in all angles so that we will be able to stop the rover before it hits something and the rover will scan for the widest open area to turn in order to avoid collision. Is there any codes to make this happen?
Does this question imply that you managed to get the SRF-04 sensor code Jim wrote specifically for you working?
Well, we couldn’t get Jim’s code working but the code we are using currently works well with our sonar and will sense when an object is within a certain distance of the robot… However we are trying to get the sonar to go on a rod to place on top of the rover so that the sonar will turn 360 clockwise then 360 counter-clockwise. We are doing this to allow the sonar to be aware of it’s surroundings. This is so that when the sonar is to detect an object in front of it, the rover will stop and it will know which direction will be safest to turn without running into something. Here is our current code:
CmConver CON 2260
cmDistance VAR Word
time VAR Word
MAIN
cmDistance = 5000
DEBUG [dec time]
cmDistance = CmConver ** time
DEBUG [dec cmDistance]
PULSOUT 15, 1
PULSIN 15, 1, time
PULSOUT 12, 1
PULSIN 12, 1, time
PULSOUT 8, 1
PULSIN 8, 1, time
PAUSE 1000
return