Go to Post If you look closer, you'll see I did those photos over a period of years... and they were only done with one program... but yeah, a little free time with no where to direct it and I can become, um, creative... - MissInformation [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
  #4   Spotlight this post!  
Unread 25-02-2004, 09:12
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: Urgent!! (programming question)

Quote:
Originally Posted by ToMMan b182
if you used pbasic in prior years, you might have used the debug statement. This year in C it is printf(). What you need to do is find the placein your code where you want to print a variable and for example write

Code:
printf("Motor 1 = %d/n", motor)
Whats in quotes will be displayed on screen when you use the hyper terminal, and the %d is used in quotes to show you want to display a decimal value. the /n is a line feed.
Don't forget the comma if you happened to copy his code. You will also want to add an explicit cast to the printf. So, something like this:
Code:
printf("\nMotor 1 = %d", (int)motor);
Just replace the motor with the pwm you want. For a joystick, do something like this:
Code:
printf("\nPort 1 Y = %d, Port 2 X = %d", (int)p1_y, (int)p1_x);
You can change the port that it is outputing to whatever you want.

Or, if the values don't change too fast, you could always just use the Dashboard from the Innovation FIRST website.
__________________

 


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
A robot Audio System punarhero Technical Discussion 9 02-02-2004 19:19
Righting a robot... archiver 2001 2 24-06-2002 00:26
Are you willing to let others take picture of your robot? Ken Leung Robot Showcase 21 10-04-2002 22:50
Kamikaze Robot Strategy... Joe Johnson Rules/Strategy 30 07-04-2002 21:42
Calling all Lawyers... ...Define "all parts" Joe Johnson General Forum 10 13-03-2002 15:12


All times are GMT -5. The time now is 07:47.

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