Go to Post So, volunteer Field Resetters are to meet in the school's weight room for training? :D - Roger [more]
Home
Go Back   Chief Delphi > Technical > Electrical
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 16-09-2014, 17:24
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
Intake Motors (Electrical/Programming)

We are currently setting up for a display that we are having tomorrow at our school, and we are having some issues with our robot.

It seems that the intake motor is not working.

We turned our robot on after the summer break and when we turned it on, the robots intake motors kept spinning when the button was clicked on the joystick, when before they stopped after the button was let go of. So what I did was that I uploaded the code that we had on right before the school year ended. I put this code on and it seems that no matter which button I clicked on the joystick (either the input or output) the intake just kept spinning without stopping for some reason.

Then I tried a different code that I think was closer to the competition time than the one we tried before.

This time the intake did not keep spinning but they only do one function. We tried many different variation of wiring and programming but not matter what both the intake and outtake buttons did only one thing (either intake or outtake depending on the variation) or sometimes it seemed the motors went opposite ways and nothing happened.

We concluded that it was a programming issue(isn't it always), so here is the code without any variation to it:

Code:
package edu.wpi.first.wpilibj.templates;
 
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Timer;
 
public class RobotTemplate extends SimpleRobot {
    
    RobotDrive chassis = new RobotDrive(1,2);
    Joystick mainStick = new Joystick(1);
    Jaguar jaguar = new Jaguar(3);
    Jaguar jag = new Jaguar(4);

    
    public void autonomous(){ 
        chassis.setSafetyEnabled(false);
        chassis.drive (-0.5, 0.08);
        Timer.delay(2.0);
        chassis.drive (0, 0.0);
    }
    
    public void operatorControl() {
        chassis.setSafetyEnabled(true);
        while (isOperatorControl() && isEnabled()) {
            double speed;
            double rot;
            speed = mainStick.getY();
            rot = -mainStick.getX();
            chassis.arcadeDrive (speed, rot);
            if (mainStick.getRawButton(3)){
                jag.set(1);
                jaguar.set(-1);
            }
            else if (mainStick.getRawButton(4)){
                jaguar.set(-1);
                jag.set(1);
            }
            else{
                jaguar.set(0);
                jag.set(0);
            }
    }
    }
    
    public void test() {
       
    }
}
If someone could please look into the code and let me know that the issue before tomorrow, this would be very helpful.
 


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 02:38.

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