![]() |
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?
|
Re: Robot Output
Quote:
It's easier if you're using Hyperterminal or another similar program. Then you can cut and paste your printf's into any editor. |
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) |
Re: Urgent!! (programming question)
Quote:
Code:
printf("\nMotor 1 = %d", (int)motor);Code:
printf("\nPort 1 Y = %d, Port 2 X = %d", (int)p1_y, (int)p1_x);Or, if the values don't change too fast, you could always just use the Dashboard from the Innovation FIRST website. |
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. |
Re: Urgent!! (programming question)
Nice work!:cool:
|
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. |
| All times are GMT -5. The time now is 13:35. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi