Go to Post Look guys, I am telling you for the fourth time - you are NEVER going to earn your official "Geek" certificates if you keep spelling "pwned" with an "O" in it! - dlavery [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 29-01-2009, 02:29
MattD's Avatar
MattD MattD is offline
Registered User
AKA: Matthew Douglas
FRC #0228 (GUS Robotics)
Team Role: Alumni
 
Join Date: Feb 2006
Rookie Year: 2005
Location: Indianapolis, IN
Posts: 185
MattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to beholdMattD is a splendid one to behold
Send a message via AIM to MattD
Re: AnalogChannel as both an accumulator AND a normal input?

You should be able to do this. The Gyro class has a constructor that accepts an existing AnalogChannel object.

Code:
/**
 * Gyro constructor with a precreated analog channel object.
 * Use this constructor when the analog channel needs to be shared. There
 * is no reference counting when an AnalogChannel is passed to the gyro.
 * @param channel The AnalogChannel object that the gyro is connected to.
 */
Gyro::Gyro(AnalogChannel *channel)
You can create an AnalogChannel and use the standard methods on it, while using the accumulator information via the Gyro class at the same time.

Code:
AnalogChannel *channel = new AnalogChannel(1);
Gyro *gyro = new Gyro(channel);

float value = channel->GetVoltage();
float angle = gyro->GetAngle();
Alternatively, you could modify the Gyro class to provide access to this information.
__________________
GUS Robotics Team 228

2010 WPI Engineering Inspiration Award
2010 WPI Regional Champions (Thanks 230 & 20!)
2010 CT VEX Champions
2010 CT VEX Innovate Award
2009 QCC VEX Champions
2009 CT Motorola Quality Award
2007 CT J&J Sportsmanship Award
2006 CT Best Website Award
Reply With Quote
 


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
<R06> normal wear and tear Darkcrosbone Rules/Strategy 54 27-01-2009 18:03
Hobbies, normal and unusual Jill1022 Chit-Chat 61 29-04-2005 08:33
Well, is it normal for me not to be in FIRST Robotics and post here? JKis6622 Chit-Chat 3 13-03-2004 15:46
physics and engineering are both cool charlie_grr Math and Science 2 03-06-2003 21:46
Both Lighter and Smaller... Jim Meyer OCCRA 2 18-09-2002 18:12


All times are GMT -5. The time now is 12:03.

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