View Single Post
  #1   Spotlight this post!  
Unread 21-01-2015, 16:54
LFRobotics's Avatar
LFRobotics LFRobotics is offline
Registered User
FRC #4623
 
Join Date: Jan 2014
Location: Little Falls, MN
Posts: 95
LFRobotics is on a distinguished road
Simple Pnuematics Program Issue

Okay so I typed up a simple pnuematics program according to examples on WPILib to extend a cylinder for a second and then retract it.

Netbeans says that it "cannot find the symbol" when I say

Code:
solenoid1 = new DoubleSolenoid(1, 2);
It is referring to not being able to find the solenoid1

Here is the program:

Code:
/*
 * 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.Driver2015.commands;

import edu.wpi.first.wpilibj.DoubleSolenoid;

/**
 *
 * @author FrankyMonez
 */
public class Solenoid1 extends CommandBase {
    
    public Solenoid1() {
        // Use requires() here to declare subsystem dependencies
        // eg. requires(chassis);
        doubleSolenoid = new DoubleSolenoid(1, 2);
        setTimeout(1);
    }

    // Called just before this Command runs the first time
    protected void initialize() {
    }

    // Called repeatedly when this Command is scheduled to run
    protected void execute() {
        doubleSolenoid.set(DoubleSolenoid.Value.kForward);
    }

    // Make this return true when this Command no longer needs to run execute()
    protected boolean isFinished() {
        return isTimedOut();
    }

    // Called once after isFinished returns true
    protected void end() {
        doubleSolenoid.set(DoubleSolenoid.Value.kReverse);
    }

    // Called when another command which requires one or more of the same
    // subsystems is scheduled to run
    protected void interrupted() {
    }
}
ANY help will be appreciated! THANKS!
Reply With Quote