|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
printf to display pwm outputs?
I know this is a really stupid question, but to be honest I never use printf regularly so I don't know how to use it. I want a simple printf to display what voltage pwm9 and pwm10 at outputting to the camera (or really, one of our mentors is requesting it to help with testing our camera issues). Can anyone help with this?
|
|
#2
|
||||
|
||||
|
Re: printf to display pwm outputs?
Assuming that you are using Servo objects to control the camera motors, you can't get the voltage going to the servos on the camera. Servos don't take analog input to move (in a sense). Instead, they take PWM to turn to a specific angle depending on the pulsewidth of the signal sent. So finding the voltage being sent won't really help you. You can use this code though to get the angle being sent to the servo:
printf("1: %f , 2: %f \n", servo1->GetAngle(), servo2->GetAngle()); Make sure you have the setup required to get debug output from the cRio. This means making a physical connection to the cRio via serial cable and making sure the little "debug" switch on the cRio is in the on position. |
|
#3
|
|||
|
|||
|
Re: printf to display pwm outputs?
Thanks for the help, this could be just what we need to finally trace the issue with our camera
![]() |
|
#4
|
|||
|
|||
|
Re: printf to display pwm outputs?
Ummm, just a quick note, contrary to what the documentation says, you do not need the serial cable to use the console. By going in to the remote systems tab, right clicking the connection to the cRio>something tools(don't remember right now)>console you can get a console to the robot without a serial cable. I think you might need to have the dip switch on the robot set to display console though. I haven't tried with the dip switch off.
Thxe |
|
#5
|
||||
|
||||
|
Re: printf to display pwm outputs?
We've ran into performance issues when using printf, which haven't been particularly consistent. As a rule of thumb, you don't want to printf too many times per second (we've found 4 to 10 works with varying results).
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PWM maximum outputs | Pneumaticsman | NI LabVIEW | 4 | 31-01-2009 16:57 |
| printf statements do not display in autonomous mode | PVC Pirates | Programming | 3 | 22-02-2005 15:41 |
| pwm outputs vs. joystick y-axis | stephenthe1 | Programming | 4 | 01-12-2004 17:29 |
| Trouble with pwm outputs | misterikkit | Programming | 16 | 17-01-2004 10:56 |
| relay and pwm outputs | nick_champ_2 | Electrical | 1 | 31-01-2003 13:08 |