Go to Post You know this crazy ChiefDelphi... nothing but useless information and kids ranting about pizza. - Amanda Morrison [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

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-02-2004, 23:36
anupalsingh anupalsingh is offline
Anupal Singh
#1219 (Iron Eagle)
Team Role: Programmer
 
Join Date: Feb 2004
Location: Toronto, Ontario, Canada
Posts: 15
anupalsingh is an unknown quantity at this point
Exclamation Urgent!!

my team and i have a question about the robot. we wish to know if there's a way to print out the output of what the robot does. Also what the values of our joystick are and so on. Anyone know how to do that?

Last edited by anupalsingh : 24-02-2004 at 23:45.
  #2   Spotlight this post!  
Unread 24-02-2004, 23:45
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,825
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Robot Output

Quote:
Originally Posted by anupalsingh
my team and i have a question about the robot. we wish to know if there's a way to print out the output of what the robot does. Also what the values of our joystick are and so on. Anyone know how to do that?
If you mean from the IFI_Loader terminal window (i.e. printf joystick values and pwm outputs), the only way I've done it is pretty crude. I've used the "Print Screen" key and pasted the result into Paint, trimed off what I don't want and printed it. You can do this with the dashboard screen as well. Trouble is, of course, you can't fit very much on the screen.

It's easier if you're using Hyperterminal or another similar program. Then you can cut and paste your printf's into any editor.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #3   Spotlight this post!  
Unread 25-02-2004, 07:27
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,187
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Urgent!! (programming question)

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.
  #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.
__________________

  #5   Spotlight this post!  
Unread 25-02-2004, 10:35
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
Re: Urgent!! (programming question)

You can log and plot about 15 seconds worth of data using the program downloaded from here: http://members.cox.net/seanwitte. There are directions in the readme file. You will need the C header and source files, pc_interface.h and pc_interface.c, that are in the zip file.

Extract all of the files onto your PC and run setup.exe to install it. You can uninstall the software using the windows add/remove programs function.

Add the C source files to your project and include pc_interface.h in user_routines.c. During the initialization make a call to InitializePCInterface() to set up the data packets. Each time through the program loop make a call to SendReceivePCData(). You can put it right before putdata().

It will let you send back 8 bytes (aliases fb_pwm01 through fb_pwm08), 6 signed integers (sensor1 through sensor6) and 16 bits (fb_sw01 through fb_sw08 and fb_sw10 through fb_sw18). You can log and plot up to ten of the values at once. Once you have a plot you can save the data as a .csv file or a bitmap. The bitmaps are huge, but its the only option I had easily available at the time. The x-axis on the plots is the time in milliseconds.

If you're using a positioning system you can display your location in a 20' by 20' workspace by setting the following values in your program:

current location X coordinate = fb_pwm07
current location Y coordinate = fb_pwm08
heading (in degrees, 0 - 359) = sensor1

The red point in the workspace is sent to the RC as (pc_p4_x, pc_p4_y). We used it to debug our positioning system on the EDU robot.
  #6   Spotlight this post!  
Unread 25-02-2004, 10:49
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,825
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Urgent!! (programming question)

Nice work!
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
  #7   Spotlight this post!  
Unread 25-02-2004, 10:53
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,574
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Urgent!! (programming question)

Sean,

Can you create a new thread about this, so that people who don't read this thread can still benefit from it.
Closed Thread


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