Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7807471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:51:49+00:00 2026-06-02T02:51:49+00:00

I am trying to create a simple version of VFH (Vector Field Histogram) on

  • 0

I am trying to create a simple version of VFH (Vector Field Histogram) on the NXT using NBC (next byte code). To do this I need to accurately measure the distance between the robot and an object. Since the NXT can show the distance in centimeters, I want to program the distance in centimeters in my program? Since there is no default centimeter reading(or is there?), can this be done or do I have to use the default sensor values? If it can, how do I do it? If not, how can I translate the ultrasonic sensor readings into centimeter readings?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T02:51:50+00:00Added an answer on June 2, 2026 at 2:51 am

    The default output is a byte value giving you centimeters.

    task main(){
       int DistanceInCm;
    
       SetSensorLowspeed(IN_4);
       while(true){
         DistanceInCm = SensorUS(IN_4);
         //do something with the value here.
         Wait(800); //or just wait.
       }
    }
    

    It’s as simple as that. The sensor reading is a byte (0-255 cm). But the NXC compiler casts it into an into an int on the fly.

    Note, though that the sensor is not very accurate! Especially if you read it while moving. So expect a lot of errors and noise in the readings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a basic version of this example in CoffeeScript: http://davidsulc.com/blog/2012/04/15/a-simple-backbone-marionette-tutorial/ .
Im trying to create a simple pan and zoom app using silverlight 4, but
I am trying to create a simple RSS parser using the two frameworks. However
I am trying to create a simple web app using Python on GAE. The
I am trying to create a simple COM server using Python 2.7 on 64
Basically I'm trying to create a simple version of the Smooth Scroll plugin due
http://jsfiddle.net/nicktheandroid/BcaW3/1/ I'm trying to create a simple canvas version of my jQuery example. When
I'm trying to create a very simple version of the game Simon with the
I am currently using XCODE 4.0.2 and am trying to create a very simple
I'm studying webrat and cucumber and trying to create simple example. Here is my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.