Quote:
Originally Posted by Briyanna
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?
|
1. Declare the compressor at the top. otherwise, the compressor will be constructed and destructed every loop, so the compressor will only be running for the brief time in the function.
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 ->