Go to Post FIRST describes this program as students working "side by side" with professional mentors. We describe our team as working "shoulder to shoulder." Maximum learning happens with maximum interaction between students and mentors, whenever and wherever that may be. - jspatz1 [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 25-01-2014, 16:54
bvisness's Avatar
bvisness bvisness is offline
Programming Mentor, Former Driver
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Woodbury, MN
Posts: 181
bvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of light
Re: Solenoid Programming Errors

The code in the WPI documentation tends to be for Java, not C++, and it looks like that's what you've written here. (At least on the third line.)

Notice that m_leftShifter is of type DoubleSolenoid*. That means it's a pointer to a DoubleSolenoid object, and so to access methods of that object (like Set()) you need to use the arrow operator (->).

Try this code instead:

Code:
DoubleSolenoid *m_leftShifter;
m_leftShifter = new DoubleSolenoid(LEFT_DRIVE_LOW,LEFT_DRIVE_HIGH);
m_leftShifter->Set(DoubleSolenoid::kForward);
Reply With Quote
  #2   Spotlight this post!  
Unread 25-01-2014, 21:01
[martinskot] [martinskot] is offline
2013 Driver
FRC #4618 (CN Robotics)
 
Join Date: Nov 2013
Rookie Year: 2013
Location: Stoney Creek, ON
Posts: 7
[martinskot] is an unknown quantity at this point
Re: Solenoid Programming Errors

That works! Thanks a ton (metric,of course).
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 14:01.

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