View Single Post
  #7   Spotlight this post!  
Unread 13-02-2015, 14:38
Oromus's Avatar
Oromus Oromus is offline
Lead Programmer, Community Liason
AKA: Ryan
FRC #1902 (Exploding Bacon)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Florida
Posts: 82
Oromus is a splendid one to beholdOromus is a splendid one to beholdOromus is a splendid one to beholdOromus is a splendid one to beholdOromus is a splendid one to beholdOromus is a splendid one to behold
Re: VEX Ultrasonic Sensor

Here's your problem:

Code:
public void robotInit() {
        ...stuff...
        ultra.setAutomaticMode(isEnabled()); <---
        ultra.setEnabled(isEnabled()); <---
        ...other stuff...
}
When robotInit is run, the robot is disabled. That means that isEnabled() will return false, which means your ultrasonic sensor is never turned on, along with automatic mode being set to false. I'd suggest just changing the lines to ultra.setEnabled(true) and ultra.setAutomaticMode(true).

Last edited by Oromus : 13-02-2015 at 14:43.
Reply With Quote