View Single Post
  #4   Spotlight this post!  
Unread 02-02-2010, 18:39
Robototes2412's Avatar
Robototes2412 Robototes2412 is offline
1 * 4 != 14
FRC #2412 (Robototes)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2007
Location: Bellevue
Posts: 312
Robototes2412 is on a distinguished road
Re: Crio does not accept new programs

We did make sure everything was wired goodwise. We are using java. heres the code:

Code:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

package edu.wpi.first.wpilibj.templates;


import edu.wpi.first.wpilibj.*;

/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the SimpleRobot
 * 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 EEARGH extends SimpleRobot
{

    Joystick xbox = new Joystick(1);
    Jaguar motor = new Jaguar(1);
    Jaguar otherMotor = new Jaguar(2);

    /**
     * This function is called once each time the robot enters autonomous mode.
     */
    public void autonomous() {
	while(isEnabled()) {
           motor.set(1);
           Timer.delay(5);
	   motor.set(0);
	   Timer.delay(5);
	}
    }

    /**
     * This function is called once each time the robot enters operator control.
     */
    public void operatorControl()
    {
        getWatchdog().setEnabled(true);
        getWatchdog().feed();
        //boolean isReversed = false;
        double speed = xbox.getRawAxis(2);
        //motor.set(0);
        while(isOperatorControl())
        {
            otherMotor.set(-speed);
            getWatchdog().feed();
        }
    }
}
sometimes the motor just spins creepily by itself, without user input.
Reply With Quote