![]() |
Compressor Code problems
Team 2895
So our team is some what new to the programming thing and we have been having problems with our code. We finally got the compressor declared but when we did that the code came up with another error saying: In member function `virtual void BuiltinDefaultCode::TeleopPeriodic()': 'class Compressor' has no member named 'Set' request for member `Set' in `((BuiltinDefaultCode*)this)->BuiltinDefaultCode::compressor', which is of non-class type `Compressor*'. Now we cant seem to get this error to go away can anyone help us? Quote:
|
Re: Compressor Code problems
Quote:
2. use a pointer (Compressor *) or not (Compressor). If you want to use the pointer, you need to init it with the = new Compressor(1, 1); line, if not, in the init location. If you are using a pointer, you access Set with a -> (and if you are not, a .) you should never have the mixed . and -> |
Re: Compressor Code problems
Quote:
|
Re: Compressor Code problems
you only need to change this bit of code:
Code:
//*Compressor |
Re: Compressor Code problems
As far know, there is no "Set" method in the Compressor object even in the base classes it inherited from. In any case, if the compressor is wired correctly with a pressure switch, you shouldn't have to do much about the compressor object. Just instantiate it, start it and forget about it. When the compressor object is instantiated, a compressor task is started automatically, this task will check if the compressor has been enabled by Start(). If so, it will monitor the pressure switch and automatically turn the relay on and off if necessary to maintain the pressure. In other words, you can just do the following with the compressor object in the constructor of your robot and nothing else. Don't use a joystick button to turn the compressor on and off. It is automatic. You don't even have to destroy the compressor in the destructor because the robot code will never end anyway, but it would be a cleaner habit of coding.
Code:
class BuiltinDefaultCode : public IterativeRobot |
| All times are GMT -5. The time now is 13:37. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi