View Single Post
  #4   Spotlight this post!  
Unread 05-02-2015, 19:32
DrOmni9885's Avatar
DrOmni9885 DrOmni9885 is offline
Registered User
FRC #1595 (Dragons)
Team Role: Programmer
 
Join Date: Feb 2013
Rookie Year: 2012
Location: Spokane, WA
Posts: 8
DrOmni9885 is an unknown quantity at this point
Re: Child function problems

Quote:
Originally Posted by bob.wolff68 View Post
If you want to use your CANTalon object, you should pass it as a pointer .

Code:
CANTalon *pMySpeedController
...
pMySpeedController->Set(x);
...
This is weird, but whenever I try deploying the code Eclipse tells me there's nothing to build for any project after I added the pointer. Here's the information from the console:

Code:
Info: Nothing to build for Encoder
Info: Nothing to build for Intermediate Vision
Info: Nothing to build for Mecanum Drive
Info: Nothing to build for Motor Control With Encoder
Info: Nothing to build for PDP CAN Monitoring
Info: Nothing to build for Simple Vision
Info: Nothing to build for Solenoids
Info: Nothing to build for [FRC2015_MAINCODE]
Info: Nothing to build for cases code
Info: Nothing to build for example
The project I'm trying to build is [FRC2015_MAINCODE]. Here's the portion of the code which I've changed:

Main program
Code:
...
	CANTalon *fan_motor_SRX;
...
	motorAutomationEncoder(e_encoder_dist, 300, -100, fan_motor_SRX, 1.0);
...
START_ROBOT_CLASS(Robot);
Header file (function):
Code:
	int motorAutomationEncoder(double encoderDist,
							   double encoderDistThresholdMax,
							   double encoderDistThresholdMin,
							   CANTalon *motor,
							   double motorSpeed)


	{
		if(encoderDist > encoderDistThresholdMax) {
			motor->Set(0.0);
		}
		else if(encoderDist <= encoderDistThresholdMax && encoderDist >= encoderDistThresholdMin) {
			motor->Set(motorSpeed);
		}
		else if(encoderDist < encoderDistThresholdMin) {
			motor->Set(0.0);
		}
	}
All other projects work when I try to deploy them. What could be wrong here?...
__________________
Code guy.

Last edited by DrOmni9885 : 05-02-2015 at 19:36. Reason: removed irrelevant sections of code
Reply With Quote