Go to Post Adversity should be seen as a challenge and not as an obstacle. :D - waialua359 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-22-2015, 10:46 PM
BananaKing1378's Avatar
BananaKing1378 BananaKing1378 is offline
BaNaNaK1Ng8o8
AKA: Banene
FRC #1378 (Hilo Banana Robotics)
Team Role: Human Player
 
Join Date: Jun 2014
Rookie Year: 2008
Location: Pluto
Posts: 7
BananaKing1378 is an unknown quantity at this point
Double Solenoid error in Eclipse

Hello! We are currently trying to set up a double acting solenoid in Eclipse.

First we create a DoubleSolenoid called Solenoid with the following line:
DoubleSolenoid Solenoid;

Next we construct it:
Solenoid(0,1);

Next, we try to set the Solenoid to forward. This is where the problem occurs. We are told that there is no member named "Forward". We have tried various ways of calling "set". Currently, we are using:

Solenoid.Set(DoubleSolenoid::kForward);
Reply With Quote
  #2   Spotlight this post!  
Unread 01-22-2015, 11:08 PM
GeeTwo's Avatar
GeeTwo GeeTwo is online now
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,539
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Double Solenoid error in Eclipse

Quote:
Originally Posted by BananaKing1378 View Post
Hello! We are currently trying to set up a double acting solenoid in Eclipse.

First we create a DoubleSolenoid called Solenoid with the following line:
DoubleSolenoid Solenoid;

Next we construct it:
Solenoid(0,1);

Next, we try to set the Solenoid to forward. This is where the problem occurs. We are told that there is no member named "Forward". We have tried various ways of calling "set". Currently, we are using:

Solenoid.Set(DoubleSolenoid::kForward);
Sounds like you're using C++, since :: is not part of java.

Doing a bit of googling, I found that kForward is actually a member of the class "Value" defined within DoubleSolenoid. I have never written any c++, but as I read the docs online, my best guess at this line would be:
Solenoid.Set(DoubleSolenoid::Value.kForward);
Reply With Quote
  #3   Spotlight this post!  
Unread 01-23-2015, 11:25 AM
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Double Solenoid error in Eclipse

Quote:
Originally Posted by BananaKing1378 View Post
DoubleSolenoid Solenoid;
Just a thought -- is the name "Solenoid" conflicting with a library class name? Pick something a little more descriptive, like "gearselect" or "toteflipper" and see if the error remains.
Reply With Quote
  #4   Spotlight this post!  
Unread 01-25-2015, 05:33 PM
JefferMC JefferMC is offline
Registered User
AKA: Jeff Corbett
FRC #1319 (Flash)
Team Role: Mentor
 
Join Date: Nov 2012
Rookie Year: 2005
Location: United States
Posts: 44
JefferMC will become famous soon enough
Re: Double Solenoid error in Eclipse

Quote:
Originally Posted by GeeTwo View Post
Sounds like you're using C++, since :: is not part of java.

Doing a bit of googling, I found that kForward is actually a member of the class "Value" defined within DoubleSolenoid. I have never written any c++, but as I read the docs online, my best guess at this line would be:
Solenoid.Set(DoubleSolenoid::Value.kForward);
Close, "Value." isn't necessary, the correct parameter value would be:

DoubleSolenoid::kForward

Keep in mind that if you should be able to type DoubleSolenoid, the two colons and pause, Elipse should list members of DoubleSolenoid for you. I believe the constants appear near the end.

Last edited by JefferMC : 01-25-2015 at 05:33 PM. Reason: remove a period that may cause confusion.
Reply With Quote
  #5   Spotlight this post!  
Unread 01-28-2015, 01:26 AM
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 152
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: Double Solenoid error in Eclipse

I'm voting with Alan on this one - change the name of your 'variable' Solenoid to something else. Both of those names are class names. That could be problematic.
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:12 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi