Jump to content


Si_Price

Member Since 10 Dec 2014
Offline Last Active Mar 22 2015 11:45 PM
-----

#247 modifying funduino robot code for project.

Posted by Si_Price on 16 March 2015 - 04:54 PM

You mean the distance at which it changes from the drive forward to the turn left state? That would be this code:

if(ultrasonic2Distance > 0 && ultrasonic2Distance < 6) { // there's an object in front of us

That code is saying to go into the IF statement if the distance measured is 6. Making that number smaller means the robot will have to get closer to the object before branching, making the number larger means it will branch sooner.

 

Ah okay thanks, I tried increasing it but my robot still manages to flip himself sometimes, I think it's because of the angle he approaches the wall and the radius of the distance sensor only reading from the front. I have managed to implement the flashing LED and the stop sequence though so that's something! thanks :)


  • 1


#226 modifying funduino robot code for project.

Posted by Si_Price on 06 March 2015 - 09:11 PM

just verified it works perfect, thanks so much for your help I really appreciate it. Once I've got the project up and running I'll post a link to the performance so people can see the results!


  • 1