![]() |
Pneumatics Programming
Hello,
I was just adding the pneumatics code required, and being the rookie I am :) , I came up with an error. The thing is that I used the code from http://wpilib.screenstepslive.com/s/...for-pneumatics exactly(or so I think) and there seems to be an error. The error message is: Syntax error, insert "AssignmentOperator Expression" to complete Expression. I have posted the code below: Code:
package org.usfirst.frc.team4939.robot; |
Re: Pneumatics Programming
Change this...
Code:
c->SetClosedLoopControl(true);Code:
c.setClosedLoopControl(true); |
Re: Pneumatics Programming
As Oromus said, that example is in C++. All you're doing is calling a function -- inside the Compressor object there is a function called setClosedLoopControl that takes a boolean as an argument. In Java, that would be articulated as...
Code:
c.setClosedLoopControl(true);Code:
c->SetClosedLoopControl(true);that was a horrible example imsosorry |
Re: Pneumatics Programming
Quote:
Quote:
Thank You, very much that seems to have fixed my problem. |
Re: Pneumatics Programming
Code:
package org.usfirst.frc.team4939.robot;The error code that shows up is: Multiple markers at this line - DoubleSolenoid cannot be resolved to a type - ArmsDouble cannot be resolved to a variable Thank You |
Re: Pneumatics Programming
Quote:
Code:
DoubleSolenoid ArmsDouble; |
Re: Pneumatics Programming
As Rakusan2 said, you need to declare ArmsDouble somewhere, i.e. "DoubleSolenoid ArmsDouble = new DoubleSolenoid(1, 2)". DoubleSolenoid not being able to resolved may be fixed by that as well.
|
Re: Pneumatics Programming
Quote:
That's the impression this gave me: http://wpilib.screenstepslive.com/s/...ders-solenoids |
Re: Pneumatics Programming
Quote:
|
Re: Pneumatics Programming
That example was just showing the different ways you can initialize your DoubleSolenoid; you do one constructor or the other.
|
DoubleSolenoid(in channel, out channel). Also, the compressor does not need to be instantiated. The compressor is on a closed loop controlled by the PCM. You just need to instantiate the DoubleSolenoid once, and and set the position on button values.
|
| All times are GMT -5. The time now is 22:28. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi