Quote:
Originally Posted by Ozuru
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);
...while in C++ that would be:
Code:
c->SetClosedLoopControl(true);
They both do the same thing; they're just differences between languages. It's like comparing apples to oranges -- they both can achieve the same thing (making you less hungry) but the means of doing so is relatively different.
that was a horrible example imsosorry
|
Quote:
Originally Posted by Oromus
Change this...
Code:
c->SetClosedLoopControl(true);
...to this...
Code:
c.setClosedLoopControl(true);
The "->" needs to be a "." and "Set" needs to become "set". That WPILib example is not showing the code in Java syntax. Also, for future reference, starting this year you don't have to create a Compressor object or do anything with it; if you make any pnuematics-related classes (i.e. Solenoids), the compressor turns on and regulates itself without any code needed. Also, that link appears to be a 2014 code example; you may want to look at 2015 code examples here instead. Good luck with programming! 
|
Thank You, very much that seems to have fixed my problem.