ROBOTC.net forums
http://robotc.net/forums/

#include help..?
http://robotc.net/forums/viewtopic.php?f=52&t=10374
Page 1 of 1

Author:  Anon E. Muss [ Tue Jan 27, 2015 10:58 pm ]
Post subject:  #include help..?

I wrote a header file 'Encoders.h' with two methods 'driveDistance(float cm, float speed)' and 'turnRight(float degrees, float speed)'.

I did the #include thing in my autonomous program:

#pragma config(Hubs, S1, HTMotor, HTMotor, HTMotor, HTServo)
#pragma config(Motor, mtr_S1_C1_1, rightMotor, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S1_C1_2, leftMotor, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S1_C2_1, rightLift, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S1_C2_2, leftLift, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S1_C3_1, motorH, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S1_C3_2, motorI, tmotorTetrix, openLoop)
#pragma config(Servo, srvo_S1_C4_1, liftLeft, tServoContinuousRotation)
#pragma config(Servo, srvo_S1_C4_2, liftRight, tServoContinuousRotation)
#pragma config(Servo, srvo_S1_C4_3, hookLeft, tServoStandard)
#pragma config(Servo, srvo_S1_C4_4, hookRight, tServoContinuousRotation)
#pragma config(Servo, srvo_S1_C4_5, servo5, tServoNone)
#pragma config(Servo, srvo_S1_C4_6, servo6, tServoNone)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//

#include "JoystickDriver.c" //Include file to "handle" the Bluetooth messages.
#include "Encoders.h"

void initializeRobot()
{
}
task main()
{
initializeRobot();

waitForStart(); // Wait for the beginning of autonomous phase.

driveDistance(12, 50);

turnRight(90, 12);

while (true)
{}
}

and this is my error:
**Severe*:Couldn't open '#include' file 'Encoders.h'
**Error**:Undefined procedure 'driveDistance'.
**Error**:Undefined procedure 'turnRight'.


What did I do wrong??

Author:  BurningLights [ Wed Jan 28, 2015 12:30 pm ]
Post subject:  Re: #include help..?

Where is the header file? Is it in the same directory as your program? If not, then ROBOTC won't know where to find it to include it.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/