Go to Post Please share your opinion and post whatever you want, I wouldn’t mind. Because I may be wrong. - Arefin Bari [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
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 19-03-2013, 09:15
Jaysonscott Jaysonscott is offline
Registered User
FRC #1846
 
Join Date: Mar 2013
Location: Sarnia, Ontario
Posts: 10
Jaysonscott is an unknown quantity at this point
Solenoid and compressor help

Sorry i dont mean to post another thread but our team leaves tomorrow for our regional competition and i cannot get my compressor or solenoids to work! it is probably because of my code but im not sure! can anyone help me through this step by step? It would honestly be the greatest thing ever!
-compressor
-1 double ended SMC solenoid
-2 Pneumatic cylinders
Reply With Quote
  #2   Spotlight this post!  
Unread 19-03-2013, 09:26
eddie12390's Avatar
eddie12390 eddie12390 is offline
Registered User
AKA: Eddie
FRC #3260 (SHARP)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Pittsburgh
Posts: 285
eddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of lighteddie12390 is a glorious beacon of light
Re: Solenoid and compressor help

Quote:
Originally Posted by Jaysonscott View Post
Sorry i dont mean to post another thread but our team leaves tomorrow for our regional competition and i cannot get my compressor or solenoids to work! it is probably because of my code but im not sure! can anyone help me through this step by step? It would honestly be the greatest thing ever!
-compressor
-1 double ended SMC solenoid
-2 Pneumatic cylinders
Judging by the fact that you think it is is being caused by code, you should post in the Programming forum for your respective language. (Or at the very least make it clear what programming language you use and what you currently have)
__________________
Any post that I make expresses only my opinions. I do not represent the opinions of my team or of any entity affiliated with my team.

As a Mentor:
2016 - Engineering Inspiration at Greater Pittsburgh Regional

As a Driver:
2014 - Winner of Greater Pittsburgh Regional
Reply With Quote
  #3   Spotlight this post!  
Unread 19-03-2013, 09:34
Jaysonscott Jaysonscott is offline
Registered User
FRC #1846
 
Join Date: Mar 2013
Location: Sarnia, Ontario
Posts: 10
Jaysonscott is an unknown quantity at this point
Re: Solenoid and compressor help

Sorry i will post there but for the sake of perhaps using some of your expertise i will post the code here aswell can you take a look?



#include "WPILib.h"
//#DEFINE FIRST_SOLENOID 1

class RobotDemo : public SimpleRobot
{
RobotDrive myRobot; // robot drive system
Joystick stick; // only joystick
Victor Victor1;
Victor SFX_Shooter1_Victor3;
Victor SFX_Shooter2_Victor4;
Relay SFX_Loader_Victor5;
Relay SFX_Tiltmotor; //spike connected to motor

DigitalInput DigitalInput_High;
DigitalInput DigitalInput_Low;

/*
Solenoid Sole1;
Compressor Compress;
*/
//Solenoid Solenoid1;


float Shoot1_Victor3_float;
float Shoot2_Victor4_float;
float Loader_Victor5_float;


public:
RobotDemo(void):
myRobot(1, 2), // these must be initialized in the same order
stick(1), // as they are declared above.
Victor1(1),
SFX_Shooter1_Victor3(3),
SFX_Shooter2_Victor4(4),
SFX_Loader_Victor5(3),
SFX_Tiltmotor(1),
DigitalInput_High(1),
DigitalInput_Low(2),
//Solenoid1(3)
//Relay_Solenoid(2)
Sole1(4,4),
Compress(3,3)
{
myRobot.SetExpiration(0.1);
}

/**
* Drive left & right motors for 2 seconds then stop
*/
void Autonomous(void)
{
/*
myRobot.SetSafetyEnabled(false);
myRobot.Drive(-0.5, 0.0); // drive forwards half speed
Wait(2.0); // for 2 seconds
myRobot.Drive(0.0, 0.0); // stop robot
*/
SFX_Shooter1_Victor3.Set(1.0);
SFX_Shooter2_Victor4.Set(1.0);


}

/**
* Runs the motors with arcade steering.
*/
void OperatorControl(void)
{
myRobot.SetSafetyEnabled(true);
Compress.Start();
while (IsOperatorControl())
{
myRobot.ArcadeDrive(stick); // drive with arcade style (use right stick)


//Victor1.Set(1.0);
//Shoot1_Victor3_float = 1.0;

//Activates shooter at full speed with button 1
if(stick.GetRawButton(1)== 1){
SFX_Shooter1_Victor3.Set(1.0);
SFX_Shooter2_Victor4.Set(1.0);
} else{
SFX_Shooter1_Victor3.Set(0.0);
SFX_Shooter2_Victor4.Set(0.0);
}

//Actvates loader at full speed with button 2
if(stick.GetRawButton(2)==1){
SFX_Loader_Victor5.Set(Relay::kOn);
}else{
SFX_Loader_Victor5.Set(Relay::kOff);
}


//Activates tilt in either forward or reverse dependant on button and sensor
if((stick.GetRawButton(4)==1)&& (DigitalInput_High.Get()==0)) {
SFX_Tiltmotor.Set(Relay::kForward);
//SFX_Tiltmotor.Set(Relay::kOn);

}else if((stick.GetRawButton(5)==1) && (DigitalInput_Low.Get()==0)) {
SFX_Tiltmotor.Set(Relay::kReverse);
//SFX_Tiltmotor.Set(Relay::kOn);
}
else{
SFX_Tiltmotor.Set(Relay::kOff);

}
/*
if(stick.GetRawButton(6)==1){
//Solenoid1.Set(True);
Relay_Solenoid.Set(Relay::kForward);
Relay_Solenoid.Set(Relay::kOn);
}else{
Relay_Solenoid.Set(Relay::kOff);
}*/
if(stick.GetRawButton(7)==1){
Sole1.Set(TRUE);
}else{
Sole1.Set(FALSE);


}




// link
//SFX_Shooter1_Victor3 = Shoot1_Victor3_float;

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

void Test() {

}
};

START_ROBOT_CLASS(RobotDemo);
Reply With Quote
  #4   Spotlight this post!  
Unread 19-03-2013, 11:27
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: Solenoid and compressor help

Quote:
Originally Posted by Jaysonscott View Post
Sorry i dont mean to post another thread...
Then why didn't you post in the thread you already started?

Quote:
Originally Posted by Jaysonscott View Post
Sorry i will post there but for the sake of perhaps using some of your expertise i will post the code here aswell can you take a look?
That looks like the code you posted originally, before you received advice on what the parameters should be for initializing Solenoid and Compressor objects.
Reply With Quote
  #5   Spotlight this post!  
Unread 19-03-2013, 12:30
Jaysonscott Jaysonscott is offline
Registered User
FRC #1846
 
Join Date: Mar 2013
Location: Sarnia, Ontario
Posts: 10
Jaysonscott is an unknown quantity at this point
Re: Solenoid and compressor help

I posted that code again because i tried editing mycode and it didnt work! But i have solved it now thank you very much you were a great help!!
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:05.

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