|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Solenoid Breakout
wiring of the solenoid valves is proper, i do not know if the breakout is using 24 volt power as opposed to 12, however, when defining the Solenoids as such:
Sol1 = new Solenoid(1); should the word Solenoid(after new) be recognized and highlighted or does it remain unlighted. as well as, why would windriver not recognize the joystick command for GetRawButton. It recognizes everything but GetRawButton, therefore, it does not work i must use GetTrigger or GetTop. Ex. if(rightStick.GetRawButton(4)) {Sol1 -> Set(true);} |
|
#2
|
|||
|
|||
|
Re: Solenoid Breakout
I have found Wind River is a little buggy when it comes to some of the functions for highlighting. As long as the code compiles it is fine
|
|
#3
|
||||
|
||||
|
Re: Solenoid Breakout
How did you declare and instantiate rightStick? If you dynamically instantiate it such as:
Code:
Joystick *rightStick = new Joystick(n); Code:
if (rightStick->GetRawButton(4))
{Sol1->Set(true);}
|
|
#4
|
||||
|
||||
|
Re: Solenoid Breakout
I declared it as
rightStick(1, 3, 11), leftStick(2, 3, 11), .... also is this stated properly for victors? if ...... {victor1.Set(1.0);} |
|
#5
|
|||
|
|||
|
Re: Solenoid Breakout
What is with the 2,3,11?
I've always just used (1),(2),(3), etc and it has worked fine. And you cant JUST say rightStick(1). It needs to be declared as a joystick somewhere. Ex: Code:
#include "WPILib.h"
class Aweseome1610Robot: public SimpleRobot
{
RobotDrive myRobot; // robot drive system
Joystick leftStick;
Joystick rightStick;
Victor victorOfDoom;
public:
Aweseome1610Robot(void)
: myRobot(1, 2) // left side, right side
, leftStick(1)
, rightStick(2)
, victorOfDoom(5) //Victor of Doom is on PWM slot 5
{
GetWatchdog().SetEnabled(false);
}
void RobotMain(void)
{
while (true) //Bad practice, dont do that. :P
{
if(rightStick.GetRawButton(1) //Trigger
{
victorOfDoom.Set(leftStick.GetThrottle());
/*Drive the Victor based on the leftSticks throttle, because the Set function accepts a Float value, and GetThrottle returns a float. */
}
}
}
};
START_ROBOT_CLASS(Aweseome1610Robot);
|
|
#6
|
||||
|
||||
|
Re: Solenoid Breakout
Quote:
Code:
if (rightStick.GetRawButton(4))
{
Sol1->Set(true);
}
...
...
// A long way down the code if you have:
Sol1->Set(false); // This will negate what you were trying to do.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Solenoid Breakout Voltage for Pneumatics Question | Team1908 | Pneumatics | 10 | 03-27-2010 12:27 AM |
| Analog Breakout | l.li | Electrical | 5 | 02-12-2010 03:56 PM |
| Troubleshooting solenoid breakout | DuaneB | Pneumatics | 6 | 02-02-2010 10:40 AM |
| Solenoid not firing off Solenoid Breakout | spooncwru | Pneumatics | 2 | 01-30-2010 05:46 PM |
| 5 Amp Fuses for Analog Breakout & Solenoid Breakout | finman | Electrical | 3 | 12-10-2008 11:59 AM |