Go to Post A poor robot with good drivers playing on good strategy will whomp a good robot with poor drivers running on poor strategy any day. - henryBsick [more]
Home
Go Back   Chief Delphi > Technical > Programming
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
  #6   Spotlight this post!  
Unread 18-02-2006, 15:57
TuaMater TuaMater is offline
Registered User
FRC #1895
 
Join Date: Jan 2006
Location: Manassas
Posts: 10
TuaMater is on a distinguished road
Re: The silly syntax errors that won't go away!

Why won't the printf's output anything! It prints temp1: temp2: ground Vector:

aka what's the syntax for outputting doubles @($&^

double calcDistance(void)
{
double temp1 = 0.0;
double temp2 = 0.0;
double groundVector = 0.0;

printf("temp1: %4.0f ", temp1);

if (getTargetFound() == 1){

temp1 = (targetHeight - cameraHeight);

printf("temp1: %4.0f ", temp1);

temp2 = (getTiltAngle() * 3.14 / 180.0);

printf("temp2: %4.5f ", temp2);

groundVector = (temp1 / tan(temp2)) * ((temp1) / tan(temp2));

printf("Ground Vector: %f ", groundVector);

return groundVector;
}
else return 0.0;
}
 


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
C18 v2.4 -- Syntax error where there is no syntax error Joel J Programming 7 12-01-2007 17:27
Union Errors in AutoCAD indieFan Inventor 4 16-07-2004 12:54
PBASIC language syntax WizardOfAz Programming 14 30-04-2003 10:23
Digital inputs, bandwith, errors? Micah Brodsky Programming 7 20-01-2003 16:08
Specs full of errors??? Simon G Motors 1 20-01-2003 12:53


All times are GMT -5. The time now is 16:54.

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