View Single Post
  #3   Spotlight this post!  
Unread 21-12-2015, 22:43
Yanglin501st's Avatar
Yanglin501st Yanglin501st is offline
Registered User
AKA: Yang Lin
FRC #3044 (OxBe4)
Team Role: Programmer
 
Join Date: Oct 2014
Rookie Year: 2008
Location: New York
Posts: 3
Yanglin501st is an unknown quantity at this point
Re: Problem with WPI Library

Quote:
Originally Posted by euhlmann View Post
Try rebuilding the C++ Index. Right click on your project > index > rebuild
^I tried rebuilding the C++ Index like you said and nothing changed.

Quote:
Originally Posted by ozrien View Post
Also I'm not sure that is valid C++ (unless C++11 allows constructor params to be specified like that now and I didn't know).

Try to follow the example in the Talon SRX Software Reference manual section 3.4.
http://www.ctr-electronics.com/contr...ical_resources
...and since you are using CANTalons, you probably should look through the manual for help and examples.
^I went through the reference manual and tried to mimic the example code provided. As a result, it fixed the current error but I now have yellow squiggly underline under a part of my code and I'm not sure what it means.

Code:
class Robot: public IterativeRobot
{
	CANTalon motor;
	Joystick joy;
	LiveWindow *lw;

public:
	Robot () : motor(1),
			joy(1)
	{
	}

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

	void TeleopPeriodic()
	{
		double leftAxis = joy.GetY(Joystick::kLeftHand);
		motor.Set(leftAxis);
	}

	void TestPeriodic()
	{
		lw->Run();
	}
};
This was what it displayed:
"Multiple markers at this line
- Line breakpoint: Robot.cpp [line: 8]
- Member 'lw' was not initialized in this
constructor"

Thanks for the help so far, I've only programmed Java for a year and I'm still trying to understand C++ for this year's robot!
Reply With Quote