View Single Post
  #3   Spotlight this post!  
Unread 25-06-2013, 09:57
Jon Stratis's Avatar
Jon Stratis Jon Stratis is online now
Electrical/Programming Mentor
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,738
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: Robot not taking input

I don't think your Autonomous section is doing what you want. The two while loops:
Quote:
while(topMicro.get() == true) {
rollMotor = 0.4;
}


while(bottomMicro.get() == true) {
rollMotor = 0.4;
}
These don't actually set the motor speed during autonomous, they only set your local double variables. In fact, I don't see anywhere in the autonomous code where you actually send the values to the motors.

You're probably starting up in Autonomous and seeing nothing happen (because no motors are set to actual values). You are also likely getting stuck in the loops above.

In teleop, I see a similar while loop:
Quote:
while(i<3) {
rollMotor = 0.4;
if (topMicro.get() == true) {
i++;
}
}
Again, this doesn't actually send the rollMotor value to the motor - you set the local double variable, but are stuck in the loop because i never increments - you don't ever get down to the point where you send values to the controller.

It's very important to watch how you use loops when dealing with this robot code!

Edit: oops... didn't notice that c never changed from 0... I guess you won't hit those loops!
__________________
2007 - Present: Mentor, 2177 The Robettes
LRI: North Star 2012-2016; Lake Superior 2013-2014; MN State Tournament 2013-2014, 2016; Galileo 2016; Iowa 2017
2015: North Star Regional Volunteer of the Year
2016: Lake Superior WFFA
Reply With Quote