Go to Post Skill in software engineering is all about algorithmic understanding and intuition. Implemenation is an important, but ultimately secondary, concern. Programming languages are more or less arbitrary. - phrontist [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
  #5   Spotlight this post!  
Unread 13-02-2015, 15:22
Team 4939 Team 4939 is offline
Registered User
AKA: Anshul Shah
FRC #4939 (All spark 9)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Brampton
Posts: 52
Team 4939 is an unknown quantity at this point
Re: Pneumatics Programming

Code:
package org.usfirst.frc.team4939.robot;

import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.Victor;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;

/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the IterativeRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class Robot extends IterativeRobot {
	RobotDrive myRobot;
	Joystick stick;
	int autoLoopCounter;
	Victor victor;
	Compressor c;
	
    /**
     * This function is run when the robot is first started up and should be
     * used for any initialization code.
     */
    public void robotInit() {
    	myRobot = new RobotDrive(0,1,2,3);
    	stick = new Joystick(0);
    	victor = new Victor(4);
    	}
    
    /**
     * This function is run once each time the robot enters autonomous mode
     */
    public void autonomousInit() {
    	autoLoopCounter = 0;
    }

    /**
     * This function is called periodically during autonomous
     */
    public void autonomousPeriodic() {
    	if(autoLoopCounter < 100) //Check if we've completed 100 loops (approximately 2 seconds)
		{
			myRobot.drive(-0.5, 0.0); 	// drive forwards half speed
			autoLoopCounter++;
			} else {
			myRobot.drive(0.0, 0.0); 	// stop robot
		}
    }
    
    /**
     * This function is called once each time the robot enters tele-operated mode
     */
    public void teleopInit(){
    }

    /**
     * This function is called periodically during operator control
     */
    public void teleopPeriodic() {
    	double rot = -stick.getX();
    	double speed = -stick.getY();
        myRobot.arcadeDrive(speed,rot);
        if(stick.getRawButton(3)){
        	victor.set(1);
        }
        else if(stick.getRawButton(2)){
        	victor.set(-1);
        }
        else{
        	victor.set(0);
        }
        ArmsDouble= new DoubleSolenoid(1, 2); // THATS SEEMS TO BE THE PROBLEM
        ArmsDouble= new DoubleSolenoid(1, 1, 2);// THAT SEEMS TO BE THE PROBLEM
        if(stick.getRawButton(4)){
        	ArmsDouble.set(DoubleSolenoid.Value.kForward);
        	
        }
        else if(stick.getRawButton(5)){
        	ArmsDouble.set(DoubleSolenoid.Value.kReverse);
        	
        }
    }
    /**
     * This function is called periodically during test mode
     */
    public void testPeriodic() {
    	LiveWindow.run();
    }
    
}
I seem to have a different problem now.

The error code that shows up is: Multiple markers at this line
- DoubleSolenoid cannot be resolved
to a type
- ArmsDouble cannot be resolved to a
variable

Thank You
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 22:28.

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