|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
when i download the code to the robot, the DS will say no code, but if i comment out the spike code, everything runs fine... any ideas why, offer help and solutions?
this is my code with the victor part commented out: #include "WPILib.h" /** * This is a demo program showing the use of the RobotBase class. * The SimpleRobot class is the base of a robot application that will automatically call your * Autonomous and OperatorControl methods at the right time as controlled by the switches on * the driver station or the field controls. */ class RobotDemo : public SimpleRobot { RobotDrive *mecanumDrive; // robot drive system DriverStation *ds; // driver station Joystick *xbox; Joystick *LeftStick; Joystick *RightStick; Victor *ArmLift; Victor *ClawTwist; // Relay *Claw; Victor *ArmLift2; public: RobotDemo(void) { xbox = new Joystick(1); ds = DriverStation::GetInstance(); mecanumDrive = new RobotDrive(1, 2, 3, 9); //frontLeft, RearLeft, FrontRight, RearRight LeftStick = new Joystick(3); RightStick = new Joystick(2); // Claw = new Relay(1); ArmLift = new Victor(6); ArmLift2 = new Victor(7); ClawTwist = new Victor(8); } void Autonomous(void) { GetWatchdog().SetEnabled(false); mecanumDrive->MecanumDrive_Cartesian(0.0, 0.0, 0.0); } void OperatorControl(void) { GetWatchdog().SetEnabled(true); while (IsOperatorControl()) { GetWatchdog().Feed(); mecanumDrive->MecanumDrive_Cartesian(xbox->GetX(), xbox->GetY(), xbox->GetZ()); ArmLift->Set( RightStick->GetY()); ArmLift2->Set(RightStick->GetX()); ClawTwist->Set((LeftStick->GetY())*.25); /** GetWatchdog().Feed(); if (RightStick->GetTrigger()) // If Right Joystick Trigger is HELD Claw->Set(Relay::kForward); if (LeftStick->GetTrigger()) // If Right Joystick Trigger is HELD Claw->Set(Relay::kReverse); else // If Right Joystick Trigger is RELEASED Claw->Set(Relay::kOff);**/ } } }; START_ROBOT_CLASS(RobotDemo); Last edited by Cody Trey : 17-02-2011 at 18:20. Reason: typos.... |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|