Go to Post At GLR our team only had to deal with a bunch on kids seeing snow for the first time. With all the ensuing snow fights and vainly trying to run up the giant snowy hill behind the arena. - Kevin Sevcik [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 17-02-2016, 18:23
TomorrowsGuru TomorrowsGuru is offline
Registered User
FRC #3239
 
Join Date: Feb 2016
Location: Utah
Posts: 1
TomorrowsGuru is an unknown quantity at this point
Double Solenoid Function Error

We're trying to use several double solenoids in C++, but we keep getting an error. no matching function for call to
Code:
'DoubleSolenoid::DoubleSolenoid()'
Here's the code we're trying to use:
Code:
#include "WPILib.h"
class Robot: public SampleRobot {
Joystick driver;
DoubleSolenoid shootingArm;
DoubleSolenoid shifter;
DoubleSolenoid pusher;

const double kUpdatePeriod = 0.005;

// Numbers of the buttons to use for triggering the solenoids.
const int kSolenoidButton = 4;
const int kDoubleSolenoidForward = 2;
const int kDoubleSolenoidReverse = 3;

public:
Robot() :
        driver(0), // Use joystick on port 0.
        // Use double solenoid with Forward Channel of 1 and Reverse         of 2.
        shootingArm(1, 2)
{
}

void OperatorControl()
{
    while (IsOperatorControl() && IsEnabled())
    {
        if (driver.GetRawButton(kDoubleSolenoidForward))
            shootingArm.Set(DoubleSolenoid::kForward);
        else if (driver.GetRawButton(kDoubleSolenoidReverse))
            shootingArm.Set(DoubleSolenoid::kReverse);
        else
            shootingArm.Set(DoubleSolenoid::kOff);

        Wait(kUpdatePeriod);                // wait for a motor update time
    }
}
};

START_ROBOT_CLASS(Robot)
Any help would be appreciated.
Reply With Quote
  #2   Spotlight this post!  
Unread 17-02-2016, 21:56
SuperBK's Avatar
SuperBK SuperBK is offline
Registered User
AKA: BrianK
FRC #1225 (Amperage Robotics)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Henersonville, NC
Posts: 357
SuperBK is just really niceSuperBK is just really niceSuperBK is just really niceSuperBK is just really nice
Re: Double Solenoid Function Error

You need to add initializations for the pusher and shifter. Those are calls to the constructor of the class. 'DoubleSolenoid:oubleSolenoid()

Code:
Robot() :
        driver(0), // Use joystick on port 0.
        // Use double solenoid with Forward Channel of 1 and Reverse of 2.
        shootingArm(1, 2),
		shifter(3,4),
		pusher(5,6)
__________________
Brian K
Team 1225 Robotics Mentor
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 03:00.

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