Go to Post .....just don't hurt the programmer =) - mtaman02 [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 14-07-2009, 17:34
Happyisgood Happyisgood is offline
Registered User
FRC #3161 (Tronic Titans)
Team Role: College Student
 
Join Date: May 2009
Rookie Year: 2009
Location: Canada
Posts: 23
Happyisgood is an unknown quantity at this point
C++ Relay Code?

Hey!

I seem to have a constant stream of programming problems, but here's my problem.

I can get a relay to work in a basic code (two drive motors, left and right, one joystick plus a single relay.) However whenever I try to move the code over to my FULL bot code (with many motors and two Joysticks) the code just fails.

What I'm using is the following (only parts of it)

Code:
#include <WPILib.h>

class RobotDemo public IterativeRobot
{
Relay *hRelay;
Joystick *stickDrive;

public:
RobotDemo()
{
     hRelay = new Relay(1);
     stickDrive = new Joystick(1);
}
void TeleopPeriodic()
{
     if(stickDrive->GetTrigger())
            hRelay->Set(Relay::kForward);
     else
            hRelay->Set(Relay::kOff);
}
};
START_ROBOT_CLASS(RobotDemo);
This is the parts of the code that included any Relay related stuff. If that runs alone (or almost alone) it works, if that runs in the full program, it doesn't. Any suggestions?


EDIT : Perhaps I should rephrase. What could possibly be in my code to cause this particular part of the code not to work?
__________________
2009 - Waterloo Regional - Regional Finalist
2009 - Waterloo Regional - Engineering Inspiration Award


________________________

2009 Team Member 1334

Last edited by Happyisgood : 14-07-2009 at 21:01.
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Relay (Spike) elbuo Electrical 2 09-02-2009 20:36
Relay Problems starsROBOTICS NI LabVIEW 2 30-01-2009 23:40
Instance relay Team_486 Programming 0 28-03-2007 09:56
Intermittent CODE ERROR, followed by uncommanded relay switching tcj103 Programming 4 22-01-2007 02:59
Relay outputs on rc jdawson Electrical 4 26-01-2003 12:51


All times are GMT -5. The time now is 12:21.

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