Go to Post but then again, isn't FIRST a sport? I mean come on now, our championship is nothing less than the super bowl. :) - Arefin Bari [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 24-11-2016, 14:51
FRC Team CC FRC Team CC is offline
Registered User
FRC #6560 (Charging Champions)
 
Join Date: Sep 2014
Rookie Year: 2012
Location: Southern California
Posts: 102
FRC Team CC is an unknown quantity at this point
Basic motor programming help

Hello,

We are trying to get two motors to run with this program, but when we run it, the build is successful but nothing happens. We are using the Java Deploy feature to compile the program to the RoboRio. Both of our Talon SRX motors have successfully connected to our RoboRio using CAN cables and are showing orange alternating lights.

We are assuming that the motors should automatically run once we deploy the program, but we may be wrong about this. Is there something wrong in our code below or our method of compilation?

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

//import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.CANTalon;
import edu.wpi.first.wpilibj.SampleRobot;
//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 SampleRobot {
	RobotDrive myRobot;
	Joystick stick;
	int autoLoopCounter;
	CANTalon testMotor0 = new CANTalon(1);
	CANTalon testMotor1 = new CANTalon(15);
	
    /**
     * 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(testMotor0, testMotor1);
    	//stick = new Joystick(0);
    }
    
    /*
     * 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() {
    	//testMotor0.set(0.2);
    	while(isAutonomous() && isEnabled()) {
    		myRobot.setSafetyEnabled(false);
    		myRobot.drive(-0.5, 0.0);
    		Timer.delay(2.0);
    		myRobot.drive(0.0, 0.0);
    	}
    }
    
}
Thanks,
Charging Champions
__________________
The Charging Champions
FTC Team #8660
Facebook Page: https://www.facebook.com/chargingchampions
Follow us on Twitter: @FtcTeamCC
Google Plus: https://plus.google.com/112552147224383900922/posts
Youtube channel: https://www.youtube.com/channel/UCop...G3zsvQKCXF4ESQ
Blog: http://chargingchampionsblog.blogspot.com/

Last edited by FRC Team CC : 24-11-2016 at 15:11.
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 09:30.

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