View unanswered posts | View active topics It is currently Thu Oct 30, 2014 3:13 pm






Reply to topic  [ 2 posts ] 
HELP!!!!!!!!! 
Author Message
Rookie

Joined: Tue Dec 23, 2008 2:42 pm
Posts: 12
Post HELP!!!!!!!!!
Im having some trouble with the program.

#pragma config(Hubs, S1, HTMotor, HTServo, HTMotor, none)
#pragma config(Motor, motorD, left_motor, tmotorNormal, openLoop, )
#pragma config(Motor, motorE, right_motor, tmotorNormal, openLoop, )#pragma config(Motor, motorE, Arm_Motor, tmotorNormal, openLoop, )
#pragma config(Servo, servo1, serv1, tServoNormal)
#pragma config(Servo, servo2, serv2, tServoNormal)
#pragma config(Servo, servo3, serv3, tServoNormal)
#pragma config(Servo, servo4, serv4, tServoNormal)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#include "JoystickDriver.c" //Include file to "handle" the BT messages.
task main()
{
while (true) //Loop forever
{
getJoystickSettings(joystick); //You had two of those
motor[left_motor] = joystick.joy1_y2;
motor[right_motor] = joystick.joy1_y1;
if(joy1Btn(1))
{
servoTarget[servo1] = 250;
}
else
{
servoTarget[servo1] = 0;
}
if(joy1Btn(5))// before it was !=0 but it isn't needed
{
servoTarget[servo2] = 0;
servoTarget[servo3] = 150;
}
else
{
servoTarget[servo2] = 200;
servoTarget[servo3] = 0;
}
if(joy1Btn(1))
{
servoTarget[servo4] = 0;
}
else
{
servoTarget[servo4] = 250;
}
if(joy2Btn(6))
{
nMotorEncoder[Arm_Motor] = 0;
nMotorEncoderTarget[Arm_Motor] = 20;
motor[motorF] = 50;
}
else if(joy2Btn(8))
{
nMotorEncoder[Arm_Motor] = 0;
nMotorEncoderTarget[Arm_Motor] = -20;
motor[motorF] = -50;
}
else
{
motor[Arm_Motor] = 0;
}
}
}

----------------------------------------------------------------------------------------------------------------------
**Error**:Undefined variable 'left_motor'. 'short' assumed.
**Error**:Undefined variable 'right_motor'. 'short' assumed.
**Error**:Undefined variable 'Arm_Motor'. 'short' assumed.
**Error**:Undefined variable 'motorF'. 'short' assumed.

Also the debugger window doesnt work.

Thanks :breakcomputer:


Thu Mar 05, 2009 8:57 pm
Profile
Novice

Joined: Fri Oct 24, 2008 8:58 am
Posts: 87
Post Re: HELP!!!!!!!!!
Use the Robot-Motors & Sensors Setup to redo the #pragma section at the top of your file.

If you need to delete everything above //*!Code automatically ... *//

The rest of your program compiles okay when that section is fixed.

I recommend not changing the #pragma section by hand unless you're 100% sure how.


Fri Mar 06, 2009 1:42 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.