View Single Post
  #2   Spotlight this post!  
Unread 06-03-2010, 16:40
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Compressor Code problems

Quote:
Originally Posted by Briyanna View Post
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 ->
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
Reply With Quote