/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.templates;

import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.Jaguar;

/**
 *
 * @author robotics
 */
public class BowlerArm {
    //NEED TO FIX SPEED TO DIRECTION CORRELATION!!!!!!!!!!!!

    private Jaguar ramp1;
    private Jaguar ramp2;
    private DoubleSolenoid arm;
    private final int JAG_PORT_1 = 5;
    private final int JAG_PORT_2 = 6;

    private final int ARM_FORWARD_PORT = 1; //orig 0; corrected to 1
    private final int ARM_BACKWARD_PORT = 2; //orig 0; corrected to 2
    private final double RAMP_SPEED = 0.25;
    private final long RAMP_WAIT = 1000;
    private final long ARM_WAIT=10;

    public BowlerArm() {
        ramp1 = new Jaguar(JAG_PORT_1);
        ramp2 = new Jaguar(JAG_PORT_2);

        arm = new DoubleSolenoid(ARM_FORWARD_PORT, ARM_BACKWARD_PORT);

    }
    /*
     forward, backward, or off. 
     */

    public void setSolenoid(int value) {
        if (value == 1) {
            arm.set(DoubleSolenoid.Value.kForward); //forward (out)
        } else if (value == 0) {
            arm.set(DoubleSolenoid.Value.kOff); //off
        } else if (value == -1){
            arm.set(DoubleSolenoid.Value.kReverse); //backward (in)
        }
    }

    
    public void setRamp(double value) {
        ramp1.set(value);
        ramp2.set(value);

    }
    
    public void rampDown(){
        setRamp(-RAMP_SPEED);
    }
    
    public void rampUp(){
        setRamp(RAMP_SPEED);
    }

    public void auto()  {
        //down
        setRamp(RAMP_SPEED); //verify sign to physical direction!!!!!!!!
        RobotTemplate.sleep(ARM_WAIT);
        //to be determined 
        setRamp(0);
        //out
        setSolenoid(1);
        //out
     
    
        //in
        setSolenoid(-1); //in
        //up
        setRamp(-RAMP_SPEED); //verify sign to physical direction!!!!!!!!
        RobotTemplate.sleep(RAMP_WAIT);
        setRamp(0);
    }
    

}

@@ -761,17 +761,16 @@
 EED = 0.
-2
 5;%0A    p
@@ -836,17 +836,19 @@
 ARM_WAIT
-=
+ = 
 10;%0A%0A   
@@ -1330,16 +1330,17 @@
 e == -1)
+ 
 %7B%0A      
@@ -1418,21 +1418,16 @@
 %0A    %7D%0A%0A
-    %0A
     publ
@@ -1513,28 +1513,24 @@
 ue);%0A%0A    %7D%0A
-    
 %0A    public 
@@ -1544,16 +1544,17 @@
 mpDown()
+ 
 %7B%0A      
@@ -1583,24 +1583,187 @@
 ;%0A    %7D%0A    
+//overloaded method used if a different speed than normal is needed%0A%0A    public void rampDown(int speedOffset) %7B%0A        setRamp(-RAMP_SPEED + speedOffset);%0A    %7D%0A
 %0A    public 
@@ -1775,16 +1775,17 @@
 rampUp()
+ 
 %7B%0A      
@@ -1806,32 +1806,198 @@
 _SPEED);%0A    %7D%0A%0A
+    //overloaded method used if a different speed than normal is needed%0A%0A    public void rampUp(int speedOffset) %7B%0A        setRamp(RAMP_SPEED + speedOffset);%0A%0A    %7D%0A%0A
     public void 
@@ -2002,17 +2002,16 @@
 d auto()
- 
  %7B%0A     
@@ -2236,18 +2236,8 @@
 out%0A
-     %0A    
 %0A   
@@ -2428,17 +2428,12 @@
 );%0A    %7D
-%0A    
 %0A%0A%7D%0A

Create methods for moving arm at different speeds