View Single Post
  #2   Spotlight this post!  
Unread 11-02-2009, 20:50
Sentient's Avatar
Sentient Sentient is offline
Registered User
FRC #0639 (Code Red)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Ithaca
Posts: 21
Sentient is on a distinguished road
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.
Reply With Quote