Computer_Guy
Member
+54|6689
Alright, I'm programming a PIC18F4550 Microcontroller to control a little robot. We were just given ultrasonic sensors to add to our robots but I'm not really sure on how i can right a program to use it. All i need it to do it sense a wall in front and turn the robot around and go back the other way.

The sensor uses a pinging system where it will hit the wall and then send a 1 to the microcontroller once it returns to the sensor, or so i think.

Al ink to the sensors page:
http://www.parallax.com/tabid/768/Produ … fault.aspx

I was thinking of just righting a delay so that it would ping a few times and then turn around, but i think this sensor can detect past 10 feet so this idea may not work.

Then I though, well if its sending a 1 for each ping then i should just have it count up to a certain value and that certain value can represent a distance away.


How should i go around implementing this sensor?

All programing is done in embedded C
HaiBai
Your thoughts, insights, and musings on this matter intrigue me
+304|5476|Bolingbrook, Illinois
Computer_Guy
Member
+54|6689
Yeah, didnt really understand it. But next class we are going to be talking about Pulse Width Modulation with a Capture Control Module to program it so hopefully that will help.

Board footer

Privacy Policy - © 2024 Jeff Minard