Go to Post What is this sleep you all speak of...if it wasn't in the KOP than it is not allowed to be used :D - Wayne Doenges [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Spotlight this post!  
Unread 15-02-2009, 20:11
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Ultrasonics / Sonar

Quote:
Originally Posted by Shira View Post
In the constructor:
Code:
m_ultra = new Ultrasonic(pingChannel, echoChannel);	
m_ultra->SetAutomaticMode(true);
range = m_ultra->GetRangeInches();
But when I print out the range I get only zeros.
Are you ever setting range anywhere else? The assignment in the constructor most likely occurs before any echoes have been received, so it won't be a valid value. I believe calling m_ultra->GetRangeInches() later should give you the current range.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
sonar is being lame Sparky_68 Programming 5 13-02-2009 00:55
How to program sonar FearlessLeader C/C++ 1 11-02-2009 22:39
Sonar Sensor help eagleslg Programming 9 05-05-2008 21:14
Ultrasonics Ctx32 Programming 1 06-06-2006 10:56
Ultrasonics Ctx32 FIRST Tech Challenge 3 06-05-2006 14:32


All times are GMT -5. The time now is 13:11.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi