Answers.Body: <p>The ultrasonic cannot detect the color of objects. It's just to detect the distance between the sensor and an object in it's line of sight.</p>
  
  <p>To find objects in the surrounding area of your robot you have to look all around. This is simply done by rotating your robot or your sensor. When you measure a distance in a certain range (best results between aprox. 10-50cm) you can stop rotating and you have your direction. Then you start to move and check for better results every 10cm or something like that again if you are still facing the right way.</p>
  
  <p>Stoping exactly in contact won't be possible unless you can say I am Xcm away and now can move exactly Xcm in this direction since the ultrasonic sensor cannot measure distances below a certain level (around 5-10cm depending on the size/shape/material of your object).</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-09-18T15:49:34.100Z
Answers.LastActivityDate: 2013-09-18T15:49:34.100Z
Answers.UserDisplayName: 5n8ke
Answers.Body: <p>Regarding the white square on the ground, the robot can not sense this using the ultrasonic sensor. This is because the ultrasonic sensor uses echolocation to navigate (hence the name "ultrasonic") If there is a white square on the ground such as a piece of paper which is essentially 2 dimensional, the sensor will not 'notice' the square. Try another method, perhaps using a 3 dimensional object, and a color sensor while you're at it.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2013-09-12T01:14:04.570Z
Answers.LastActivityDate: 2013-09-12T01:14:04.570Z
Answers.UserDisplayName: ChiggyChonga
Body: <p>I'm still new to NXT, I try to make the robot locate a ball using the ultrasonic sensor, while there I should be in a square area marked by white color.</p>
  
  <p>How can I make the robot locate the object (by ultrasonic), stop, get the distance, then move until it stops exactly in contact with the object?</p>
  
  <p>Here is my <a href="https://dl.dropbox.com/u/55280426/Try1.rbt" rel="nofollow">project</a></p>
  
Tags: <mindstorms><nxt><programming><balls>
Title: Ultrasonic problems with the red and blue balls?
UserDisplayName: Tankid
ThreadText: # Ultrasonic problems with the red and blue balls?
  
  (Asked by: username_0 on 2013-04-06)
  
  I'm still new to NXT, I try to make the robot locate a ball using the ultrasonic sensor, while there I should be in a square area marked by white color.
  
  How can I make the robot locate the object (by ultrasonic), stop, get the distance, then move until it stops exactly in contact with the object?
  
  Here is my [project](https://dl.dropbox.com/u/55280426/Try1.rbt)
  
  **Tags:** mindstorms, nxt, programming, balls
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2013-09-18. Score: 5
  
  The ultrasonic cannot detect the color of objects. It's just to detect the distance between the sensor and an object in it's line of sight.
  
  To find objects in the surrounding area of your robot you have to look all around. This is simply done by rotating your robot or your sensor. When you measure a distance in a certain range (best results between aprox. 10-50cm) you can stop rotating and you have your direction. Then you start to move and check for better results every 10cm or something like that again if you are still facing the right way.
  
  Stoping exactly in contact won't be possible unless you can say I am Xcm away and now can move exactly Xcm in this direction since the ultrasonic sensor cannot measure distances below a certain level (around 5-10cm depending on the size/shape/material of your object).
  
  
  ---
  
  ### Answer by username_2 on 2013-09-12. Score: 2
  
  Regarding the white square on the ground, the robot can not sense this using the ultrasonic sensor. This is because the ultrasonic sensor uses echolocation to navigate (hence the name "ultrasonic") If there is a white square on the ground such as a piece of paper which is essentially 2 dimensional, the sensor will not 'notice' the square. Try another method, perhaps using a 3 dimensional object, and a color sensor while you're at it.
  
  
  ---
  
  