Go to Post Joe is a great sport and this was a good moral booster after a grueling weekend. How many opportunities do you get to play William Tell with a Regional WFA Winner? :) - The Lucas [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 02-03-2010, 19:32
mrmummert's Avatar
mrmummert mrmummert is offline
Registered User
AKA: hank
FRC #1610 (bot)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: franklin
Posts: 353
mrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to behold
Send a message via Yahoo to mrmummert
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);}
Reply With Quote
  #2   Spotlight this post!  
Unread 02-03-2010, 22:14
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
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
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"
Reply With Quote
  #3   Spotlight this post!  
Unread 02-03-2010, 22:58
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 674
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Solenoid Breakout

How did you declare and instantiate rightStick? If you dynamically instantiate it such as:
Code:
Joystick *rightStick = new Joystick(n);
Then you should be doing:
Code:
if (rightStick->GetRawButton(4))
{Sol1->Set(true);}
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread 03-03-2010, 19:47
mrmummert's Avatar
mrmummert mrmummert is offline
Registered User
AKA: hank
FRC #1610 (bot)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: franklin
Posts: 353
mrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to beholdmrmummert is a splendid one to behold
Send a message via Yahoo to mrmummert
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);}
Reply With Quote
  #5   Spotlight this post!  
Unread 03-03-2010, 20:44
nighterfighter nighterfighter is offline
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
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);
Reply With Quote
  #6   Spotlight this post!  
Unread 03-03-2010, 22:02
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 674
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: Solenoid Breakout

Quote:
Originally Posted by mrmummert View Post
I declared it as

rightStick(1, 3, 11),
leftStick(2, 3, 11),
....


also is this stated properly for victors?

if ......
{victor1.Set(1.0);}
You are declaring the joysticks as having 3 axes and 11 buttons and on port 1 and 2 respectively. That looks fine. I checked the wpi library source code and it should work. There must be something else in your code that is interfering. My experience with robot programming is that you can stare at a segment of code and it looks perfectly fine but it is other part of the code that was the problem. For example:
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.
In the past, we had code to run the motors but the motors were not running. We even put some print statement in the code to make sure the code to turn the motor on was executed but the motors were still not running. It turns out some function call soon after was turning off the motors immediately. This is just to demonstrate when you have a problem that doesn't make sense, look wider.
__________________
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Solenoid Breakout Voltage for Pneumatics Question Team1908 Pneumatics 10 27-03-2010 00:27
Analog Breakout l.li Electrical 5 12-02-2010 15:56
Troubleshooting solenoid breakout DuaneB Pneumatics 6 02-02-2010 10:40
Solenoid not firing off Solenoid Breakout spooncwru Pneumatics 2 30-01-2010 17:46
5 Amp Fuses for Analog Breakout & Solenoid Breakout finman Electrical 3 10-12-2008 11:59


All times are GMT -5. The time now is 14: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