Quote:
Originally Posted by curtis0gj
This quote thing is driving me nuts, anyway this works right?
Code:
double angle = gyro1.getAngle();
double distance = encoder.getDistance();
SmartDashboard.putNumber("Angle", angle);
SmartDashboard.putNumber("Distance", distance);
Also now that I have made my distance variable can I use it in my if statement like so, if(distance > 50) ?
|
Yes you can, but you are going to want to make sure that you put the distance variable in the second loop so it gets updated when you are driving.
Another thing I forgot to have you do is reset the encoder prior to the second loop. You can do this in the same place you reset the gyro.