Let's Make Robots!

Ultrasonic range finder SRF04


I am a beginner. 

I have got a PIC18F252 to run a line follower robot. I would like the chip to run an sfr04 ultrasonic range finder SRF04.  basically if the SRF04 detects an object infront of it, it then turns away.  I am programming in C and am stuck. 

Has anyone got a programme or could somone please point me in the right direction.

 Any help would be great


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Review the Start here robot for an understanding of a simple robot that uses a range finder and has object avoidance capabilities.

Search this site for "clean_navigation.bas" for some example code in Picaxe Basic. You can use as psuedocode for figuring out your C code.

Good luck!