Go to Post I've done enough preaching to the choir. Let's carry on changing the culture. - StevenB [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 17-02-2011, 18:18
Cody Trey's Avatar
Cody Trey Cody Trey is offline
Programing = hard + fun
FRC #2582 (Panther Bots)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: US
Posts: 31
Cody Trey is an unknown quantity at this point
Send a message via Yahoo to Cody Trey
Exclamation Spike Code will not run

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);
__________________
Love, Peace, and Robot Grease

Last edited by Cody Trey : 17-02-2011 at 18:20. Reason: typos....
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


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

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