getting g++ and gcc errors

Also getting If and Else if, button value syntax errors in the start of the teleoperatedPeriod

#include “WPILib.h”

/**

  • This is an easy way to keep track of connections
  • This code assumes the following connections:
    • Driver Station:
    • USB 1 - Main Drive Xbox controller
    • USB 2 - Secondary Xbox
    • Robot:
    • Digital Sidecar 1:
  • - PWM 1 - Left Drive
    
  • - PWM 2 - Right Drive
    
  • - PWM 3 - Shooter
    
  • - PWM 4 - Ball Intake
    
  • - PWM 5 - Intake arm/lifter
    
  • - PWM 6 - Catcher
    
  • - PWM 7 - Connected to
    
  • - PWM 8 - Connected to
    
  • - PWM 9 - Connected to
    
  • -Digital Sensors
  •  -I/O 1 - Pneumatic sensor
    
  •  -I/O 2 -
    

*/

class Robot : public IterativeRobot
{

RobotDrive *TankDrive; // robot drive system
Joystick *Driver_Controller; 
Joystick *Assistant_Controller;
LiveWindow *lw;
int autoLoopCounter;

Talon *Talon0;											//Left Drive
Talon *Talon1;											//Right Drive
Talon *Talon2;											//up and down
Talon *Talon3;											//arm close and open
Talon *Talon4;											//intake wheels
Talon *Talon5;											//spare

float Left_X_Axis_Driver;										//when CamelCase doesn't fit, underscores work too
float Right_X_Axis_Driver;										//float means long decimel
float Left_Y_Axis_Driver;
float Right_Y_Axis_Driver;

float Left_X_Axis_Assist;										//when CamelCase doesn't fit, underscores work too
float Right_X_Axis_Assist;										//float means long decimel
float Left_Y_Axis_Assist;
float Right_Y_Axis_Assist;

float AutoTimer;

public:
Robot() :
TankDrive(1, 2), // these must be initialized in the same order
Driver_Controller(1), // as they are declared above.
Assistant_Controller(2),
Talon0(0),
Talon1(1),
Talon2(2),
Talon3(3),
Talon4(4),
Talon5(5),
AutoTimer(),

	lw(NULL),
	autoLoopCounter(0)


{
	TankDrive-> SetExpiration(0.1);

	Left_X_Axis_Driver  =0;										//when CamelCase doesn't fit, underscores work too
	Right_X_Axis_Driver =0;										//float means long decimel
	Left_Y_Axis_Driver  =0;
	Right_Y_Axis_Driver =0;

	Left_X_Axis_Assist  =0;										//when CamelCase doesn't fit, underscores work too
	Right_X_Axis_Assist =0;										//float means long decimel
	Left_Y_Axis_Assist  =0;
	Right_Y_Axis_Assist =0;
}

private:
void RobotInit()
{
lw = LiveWindow::GetInstance();
}

void AutonomousInit()
{
	autoLoopCounter = 0;
}

void AutonomousPeriodic(void) {

				AutoTimer=Timer::Timer();

				if(AutoTimer==0){									//starts timer and makes sure everything is stopped
					void Timer::Start();
					Talon1 -> Set(0);
					Talon2 -> Set(0);
					Talon3 -> Set(0);
					Talon4 -> Set(0);
					Talon5 -> Set(0);
				}
				else if(AutoTimer<2){								//Drive forward for 2 seconds
					Talon1 -> Set(.3);								//left drive 30%
					Talon2 -> Set(-.3);								//right drive 30%
					Talon3 -> Set(0);								//shooter 0%
					Talon4 -> Set(0);								//ball intake 0%
					Talon5 -> Set(0);								//intake arm/lifer 50%
				}
				else if(AutoTimer<7){								//Move launch motor for 5 seconds
					Talon1 -> Set(0);                               //No movement
					Talon2 -> Set(0);
					Talon3 -> Set(0);								//shooter 100%
					Talon4 -> Set(0);
					Talon5 -> Set(0);
				}
				else if(AutoTimer<8){								//Robot turning around-1 second (Zero Turn)
					Talon1 -> Set(.5);                              //Left drive 50%
					Talon2 -> Set(-.5);                              //Right drive 50% (backwards)
					Talon3 -> Set(0);
					Talon4 -> Set(0);
					Talon5 -> Set(0);
				}
				else if(AutoTimer<10){								//Nothing going on
					Talon1 -> Set(0);
					Talon2 -> Set(0);
					Talon3 -> Set(0);
					Talon4 -> Set(0);
					Talon5 -> Set(0);
				}
				else if(AutoTimer>10){								//Nothing going on
					Talon1 -> Set(0);
					Talon2 -> Set(0);
					Talon3 -> Set(0);
					Talon4 -> Set(0);
					Talon5 -> Set(0);
					void Timer::Stop();									//you can do a TON of clever stuff with one timer, and it gets bigger as you add more timers. be sure to take advantage of timers!
				}

			}

/** XBOX Controller Notes

		* Buttons:
			* A=1
			* B=2
			* X=3
			* Y=4
			* LB=5
			* RB=6
			* Back=7
			* Start=8
			* LeftAnalog=9
			* RightAnalog=10

		* Axis:
			* LeftX=1
			* LeftY=2
			* RightX=4
			* RightY=5
			* Trigger=3 (Left moves -, Right moves +)
		 */

void TeleopInit()
{

}

void TeleopPeriodic()
{
	void RobotDrive::TankDrive (float leftValue,float rightValue,bool squaredInputs = true);

	Talon1 -> Set(-Left_Y_Axis_Driver); 				//Sets speed to Joy stick value
	Talon2 -> Set(Right_Y_Axis_Driver);
	

	if(Driver_Controller->bool GetRawButton(5)==0){ 
		Talon3->Set(1);
	}

	else if(Driver_Controller->bool GetRawButton(9)==0){
		Talon3->Set(-1);

	}
	else{												//never forget your else
		Talon3->Set(0);

	}
	TestPeriodic();
{
	lw->Run();
}

};

'START_ROBOT_CLASS(Robot);

Please edit your post and add code] and /code] tags around your code. Without them, any formatting you use is lost (and it takes up a whole lot of page).

Ok…I apologize for the original post. I had a former student that came back this year to try to mentor post, and it was not very organized.

We have looked at other posts and come to the realization that the g++ and gcc errors SHOULDN"T be a big deal…hopefully that works out for us. Here is what we are having trouble with still:

All we are trying to do is program an XBox controller button. Last year in Windriver, we wrote the program this way:

if(Assist_Controller->GetRawButton(4)==1{
Talon5->Set(1);
}
else if(Assist_Controller->GetRawButton(1)==1){
Talon5->Set(-1);
}
else{
Talon5->Set(0);

This would make the “Y” button make the motor go one direction and the “A” button go the other direction.

This year, we have looked through the libraries and are unable to figure out how to code this appropriately. So far, this is what our coding team has come up with, but it results in a yellow question mark and says “Syntax Error”:

if(Driver_Controller->bool GetRawButton(4)==0){
Talon3->Set(1);
}
else if(Driver_Controller->bool GetRawButton(1)==0){
Talon3->Set(-1);
}
else{
Talon3->Set(0);

Will this code work? If there is something wrong with this, any help is greatly appreciated.

Our coding mentor from the past two years is deep into his Electrical Engineering Degree and is not able to commit time to help us this year. I am the team lead mentor, but am having a very difficult time with programming (I am woodshop teacher by trade, trying to build robots with kids). We stuck with C++ because we liked our code from last year and had the basics understood, but with the Eclipse small changes are struggling.

Thank you in advance for your time and help.

…by the way, I tried to go in and edit the first post, and cannot figure out where to go to make that happen.

You will almost certainly have trouble with the lines:

if(Driver_Controller->**bool** GetRawButton(4)==0){

and

else if(Driver_Controller->**bool** GetRawButton(1)==0){

You should not have that bolded bool there; it simply is not necessary in C/C++ to put that identifier there when calling a function. It’s certainly possible that you have other problems, but your code won’t compile if you leave those in.

If you are still having issues, it would be convenient if you specifically quoted the error in question and identified the line corresponding to the error (most error messages will mention a line number; if you can point out exactly which line the error message is referring to, it is easier for people to help). Also, the code tags mentioned earlier are helpful for formatting; if you put a large chunk of code in code tags then it will keep constant width characters and handle whitespace nicely, as well as condensing the code so it doesn’t take up as much space when scrolling through the thread.

Your exact code from last year should be the fine, but the button mappings may or may not have changed, check the USB tab on the DriverStation for your controller to make sure you are getting the right button (they start at 1 in C++ and Java WPILib).

The bool in the middle is probably the source of your syntax error.