Go to Post Organization is the one skill that can help make *any* workshop work. - tjf [more]
Home
Go Back   Chief Delphi > Technical > Control System > Sensors
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 20-01-2015, 16:57
FurryFaust's Avatar
FurryFaust FurryFaust is offline
Registered User
FRC #0334
 
Join Date: Nov 2014
Location: Brooklyn, New York
Posts: 4
FurryFaust is an unknown quantity at this point
Vex Ultrasonic not working for new 2015 system

The Vex Ultrasonics' code is crashing the robot. As soon as a certain line of code runs (pinpointed on robot init), the driver station immediately disables and says no robot code. I have tested this with 2014's robot system which has not been an issue however this issue only occurs with 2015's.

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

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Ultrasonic;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

public class Robot extends IterativeRobot {

	Ultrasonic ultrasonic = new Ultrasonic(1, 2);

	public void robotInit() {
		ultrasonic.setAutomaticMode(true);
	}

	public void autonomousPeriodic() {
		SmartDashboard.putNumber("Ultrasonic Value", ultrasonic.getRangeInches());
		
	}

	public void teleopPeriodic() {

	}

	public void testPeriodic() {

	}
}
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 08:03.

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