Go to Post FIRSTers in particular want very strictly delineated guidelines so that they know exactly what parameters under which they're working, except when they don't. - pfreivald [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 02-17-2016, 09:27 AM
VrewDaive VrewDaive is offline
Registered User
FRC #4284
 
Join Date: Sep 2015
Location: Cincinnati
Posts: 21
VrewDaive is an unknown quantity at this point
pneumatics help, noob programmer.

Hey everyone! this is our first year using really any kind of pneumatics, our team has all of the hardware, (PCM, Compressor, DoubleSolenoids etc) what we would like is the basic understanding of the coding side of things, i understand that you need to write the PCM in CAN, im really unsure of what that entails. here is the code right now




Code:
    /**
	     * This function is run when the robot is first started up and should be
	     * used for any initialization code.
	     * 
	     */  RobotDrive myDrive, frontCatcher, backCatcher, windowDrive;
	    	Joystick moveStick;
	    	Relay Relay1, Relay2;
	    	//ADXRS450_Gyro scotbot;
	    	//Solenoid S;
	    	Compressor C;
	    	DoubleSolenoid DS;
	
	    	
	    public void robotInit() {
	    	Talon TalLF = new Talon(0);
	    	Talon TalLR = new Talon(1);
	    	Talon TalRF = new Talon(2);
	    	Talon TalRR = new Talon(3);
	    	Jaguar Window1 = new Jaguar(4);
	    	Jaguar Window2 = new Jaguar(5);
	    
	    	//Talon TalCatcher = new Talon(4);
	    	//Talon TalCatcher1 = new Talon(5);
            //Talon TalCatcher2 =  new Talon(6);
	    	myDrive =  new RobotDrive(TalLF,TalLR,TalRF,TalRR);
	        //frontCatcher = new RobotDrive(TalCatcher,TalCatcher1);
            //backCatcher = new RobotDrive(TalCatcher1, TalCatcher2);
	    	windowDrive = new RobotDrive(Window1, Window2);
	    	moveStick = new Joystick(0);
	    	
	    	//scotbot = new ADXRS450_Gyro();
	    	DoubleSolenoid DS = new DoubleSolenoid(0, 1);
	    	Compressor C = new Compressor(0);
	    	Relay1 = new Relay(0);
	        Relay2 = new Relay(1);
	    }
	
	    /**
	     * This function is called periodically during autonomous
	     */
	    public void autonomousPeriodic() {
	    		myDrive.mecanumDrive_Cartesian(1, 1, 1, 0);
	    		// catcherDrive.drive(1, 0);
	    }
	    /**
	     * This function is called periodically during operator control
	     */
	    public void teleopPeriodic() {
	    	C.setClosedLoopControl(false);
	    	
	    	
	       myDrive.mecanumDrive_Cartesian(moveStick.getRawAxis(0), moveStick.getRawAxis(1), -moveStick.getRawAxis(5), 0);
	       
	       if(moveStick.getRawButton(3))
	    	{
	    	   windowDrive.drive(1,1);	    			
	    	}
	       else
	    	   if (moveStick.getRawButton(2))
	    	   {
	    		   windowDrive.drive(-1,1);
	    	   }

	    }
but every time we enable the teleop it shorts out and exits very quickly.

Thanks
Reply With Quote
 


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 08:05 AM.

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