Go to Post Don't let my students know I skimmed that blog and didn't read it thoroughly. - rlance [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
  #1   Spotlight this post!  
Unread 07-02-2009, 09:27
Chief Pride's Avatar
Chief Pride Chief Pride is offline
<3
AKA: James Kiefer
no team
 
Join Date: Sep 2007
Rookie Year: 2007
Location: Kalamazoo, MI
Posts: 653
Chief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond reputeChief Pride has a reputation beyond repute
Passing a motor as an argument in a function

Hello, I am trying to pass a speed controller (victor) as an BYREF argument in a function and set its value, however, the motor wont turn on and I get no errors. Here is what it looks like:

Code:
void SpecialControl(SpeedController &Motor); /* prototype */
class Robot : public SimpleRobot
{
	Victor InitialMotor;
	public:
		Robot(void):		// these must be initialized in the same order 
		InitialMotor(1)
	{
		GetWatchdog().SetExpiration(0.1);
	}



void OperatorControl(void)
	{
		GetWatchdog().SetEnabled(true);
		SpecialControl(InitialMotor);
	}
};

void SpecialControl(SpeedController &Motor)
{
	Motor.Set(1);
}
Thanks in advance.
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
Team Argument! dmoody92 General Forum 30 05-02-2009 09:28
Generate_Pwms argument error in MPLAB LieAfterLie Programming 6 06-12-2007 17:01
Motor Ramp Up/Ramp Down Function Tom Bottiglieri Programming 12 03-12-2006 23:31
Motor drive function? Mike Programming 3 15-02-2006 11:55
Pbasic argument question... Ghetto_Child Programming 10 18-02-2002 09:23


All times are GMT -5. The time now is 13:15.

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