Go to Post since when is not sleeping, caring more about the robot and such bad for you? If it is how come I didn't get the memo? :ahh: - Sakura141 [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-01-2015, 10:24
Mr.Roboto3335's Avatar
Mr.Roboto3335 Mr.Roboto3335 is offline
Wait, What?
AKA: Jimmy
FRC #3335 (Cy-Borgs)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Texas
Posts: 47
Mr.Roboto3335 is an unknown quantity at this point
Roborio + Motor Controllers

I've been having some trouble getting the motor controllers to connect to the roboRio. When I enable teleop, the motor controllers still flash as if teleop was disabled. I was wondering if this was a wiring or a software issue. Here's my code.
Code:
package org.usfirst.frc.team3335.robot;

/*----------------------------------------------------------------------------*/
/* 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.                                                               */
/*----------------------------------------------------------------------------*/

import edu.wpi.first.wpilibj.*;

import edu.wpi.first.wpilibj.vision.*;

public class Robot extends IterativeRobot {

	private Joystick controller;
	private RobotDrive drive;
	private SpeedController one, two, three, four, lift;
	//private AxisCamera camera;
	//private DigitalInput limit;

	public void robotInit() {
		joystickInit();
		//sensorInit();
		speedControllerInit();
		robotDriveInit();
	}

	//public void sensorInit() {
		//limit = new DigitalInput(0);
	//}

	public void joystickInit() {
		controller = new Joystick(0);
	}

	public void speedControllerInit() {
		one = new Victor(0);
		two = new Victor(1);
		three = new Victor(2);
		four = new Victor(3);
		lift = new Victor(4);
	}

	public void robotDriveInit() {
		drive = new RobotDrive (lift,two, three, four);
	}

	public void autonomousPeriodic() {

	}

	public void teleopPeriodic() {
		double y = getDeadZone(controller.getY(), 0.1);
		double x = getDeadZone(controller.getThrottle(), 0.1);
		drive.arcadeDrive(y, x);
		if (controller.getRawButton(2)) {
			one.set(-1);
		} else if (controller.getRawButton(1)){
			//	&& limit.get()) 
				
			one.set(1);
		} else {
			one.set(0);
		}

	}

	public void testPeriodic() {

	}

	public double getDeadZone(double axis, double zone) {

		return Math.abs(axis) > zone ? axis : 0;
	}
}
__________________
Wait, what?
Reply With Quote
  #2   Spotlight this post!  
Unread 17-01-2015, 12:47
Mr.Roboto3335's Avatar
Mr.Roboto3335 Mr.Roboto3335 is offline
Wait, What?
AKA: Jimmy
FRC #3335 (Cy-Borgs)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Texas
Posts: 47
Mr.Roboto3335 is an unknown quantity at this point
Re: Roborio + Motor Controllers

It was just a wiring issue.
__________________
Wait, what?
Reply With Quote
  #3   Spotlight this post!  
Unread 17-01-2015, 12:52
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,043
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Roborio + Motor Controllers

Quote:
Originally Posted by Mr.Roboto3335 View Post
It was just a wiring issue.
Thank you for following up.

Would you mind posting a few more details? Others are reading and this might be a teaching moment.


Reply With Quote
  #4   Spotlight this post!  
Unread 17-01-2015, 14:01
Mr.Roboto3335's Avatar
Mr.Roboto3335 Mr.Roboto3335 is offline
Wait, What?
AKA: Jimmy
FRC #3335 (Cy-Borgs)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Texas
Posts: 47
Mr.Roboto3335 is an unknown quantity at this point
Re: Roborio + Motor Controllers

I recommend that you make sure the pwm cables are not backwards and that your electrician is well rested when wiring.
__________________
Wait, what?
Reply With Quote
Reply


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 11:39.

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