Go to Post Changing the world starts with changing yourself. - Jeremy_Mc [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 15-02-2012, 21:17
guoruiwu1994 guoruiwu1994 is offline
Registered User
FRC #1815
 
Join Date: Feb 2010
Location: Toronto
Posts: 15
guoruiwu1994 is an unknown quantity at this point
Robot motors don't turn

Two weeks ago, everything in the robot was working, then one day we come in, and nothing works anymore; the motors don't turn.

After a while, we find out that the jaguars are all broken somehow, so we replaced them with Victors. However, the robot still won't work. We've reduced our code to the most basic so it is only controlling the motors. However, the motors still won't turn at all.

Is there something wrong with our 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.RobotDrive;


import edu.wpi.first.wpilibj.SimpleRobot;

/**
 * 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 RobotTemplate1 extends SimpleRobot
  {

    /**
     * This function is called once each time the robot enters autonomous mode.
     */
    RobotDrive m_robotDrive;		// robot w'ill use PWM 1-4 for drive motors
    static final int UNINITIALIZED_DRIVE = 0;
    static final int ARCADE_DRIVE = 1;
    static final int TANK_DRIVE = 2;
    int m_driveMode;

    public void autonomous()
      {
      }

    /**
     * This function is called once each time the robot enters operator control.
     */
    public void operatorControl()
      {
        m_robotDrive = new RobotDrive(1, 2, 3, 4);
        while (isOperatorControl() && isEnabled())
          {
            m_robotDrive.setSafetyEnabled(false);
            m_driveMode = ARCADE_DRIVE;
            //m_robotDrive.arcadeDrive();
            m_robotDrive.arcadeDrive(-0.5, 1);
            System.out.println("hello");

          }
      }
  }
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 18:12.

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