Go to Post I would be thankful to just participate in champs, I would be happy with just that. - Brandon_L [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
  #5   Spotlight this post!  
Unread 08-02-2015, 16:53
PredaFran PredaFran is offline
Amateur Programmer
AKA: Francisco
FRC #5285 (Sea Kings Robotics)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2015
Location: California
Posts: 25
PredaFran is an unknown quantity at this point
Re: Help with toggle-button

i have this code so far, i cant get it to work, any idea of what could be wrong?



Code:
#include "WPILib.h"

class Robot: public SampleRobot
{
	bool Piston;
	Joystick stick; // joystick

	Piston = false; 
	Talon m_motor1;
	Talon m_motor2;
public:
	Robot() :
		m_motor1(1),	
		stick(0)
}

{
		myRobot.SetExpiration(0.1);
	
}
	if(Piston){
		m_motor1.Set(Stick.GetY()); // Where as the talon1 would be controlled by the Y axis of the Joystick
	} else if (!Piston){
		m_motor2.Set(Stick.GetY());// Where as another talon, talon2, would be controlled by the Y axis of the Joystick
	}





};

START_ROBOT_CLASS(Robot);
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 14:03.

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