Go to Post OMG this topic again. Those who stir the pot should lick the spoon. - nuggetsyl [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-11-2009, 07:52 PM
iTHOS=awesome iTHOS=awesome is offline
Registered User
FRC #1258
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Seattle
Posts: 16
iTHOS=awesome is an unknown quantity at this point
Send a message via MSN to iTHOS=awesome
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?
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread 02-11-2009, 08:50 PM
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
  #3   Spotlight this post!  
Unread 02-11-2009, 09:07 PM
iTHOS=awesome iTHOS=awesome is offline
Registered User
FRC #1258
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Seattle
Posts: 16
iTHOS=awesome is an unknown quantity at this point
Send a message via MSN to iTHOS=awesome
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
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread 02-11-2009, 09:56 PM
Thxe Thxe is offline
Registered User
FRC #2535
 
Join Date: Jan 2009
Location: Tigears
Posts: 17
Thxe is an unknown quantity at this point
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
Reply With Quote
  #5   Spotlight this post!  
Unread 02-13-2009, 10:22 AM
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,033
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
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).
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
Reply


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
PWM maximum outputs Pneumaticsman NI LabVIEW 4 01-31-2009 04:57 PM
printf statements do not display in autonomous mode PVC Pirates Programming 3 02-22-2005 03:41 PM
pwm outputs vs. joystick y-axis stephenthe1 Programming 4 12-01-2004 05:29 PM
Trouble with pwm outputs misterikkit Programming 16 01-17-2004 10:56 AM
relay and pwm outputs nick_champ_2 Electrical 1 01-31-2003 01:08 PM


All times are GMT -5. The time now is 10:11 AM.

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