I am having trouble programming my ultrasonic sensor to make it sense anything in front of it. I am using while ( Sensorvalue[Ultrasonic] < 2) then have it move in the while loopHowever, when I point my robot to a wall that is really close to it (<1 inch). It doesn't seem to function.What is the problem?. Please help.

Wed Dec 05, 2012 11:09 am

amcerbu

Novice

Joined: Sun Oct 21, 2012 10:01 pmPosts: 76

Re: Ultrasonic sensor problems

Can you please post the entire code inside of [code] and [/code] tags? That'll help us diagnose a syntax or logic error.

Wed Dec 05, 2012 11:54 am

JohnWatson

Site Admin

Joined: Thu May 24, 2012 12:15 pmPosts: 663

Re: Ultrasonic sensor problems

This may also be an issue of the sensor being outside of its usable range. Sonar sensors have a maximum and minimum range that they will work properly within; if the object being detected is too far away, the echoes either won't reach the sonar receiver with enough strength to be detected, or will take too long to 'ping' back to the receiver. If the object is too close, the sound wave 'pings' back too quickly for the sonar sensor to read it.

Taking a look at the Ultrasonic Range Finder's product page on VEX's website, we see that the usable range for the sensor is "1.5 in to 115 in". Thus, moving an object any closer to the sensor than that may give unreliable results.

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum