View Single Post
  #21   Spotlight this post!  
Unread 21-02-2015, 11:52
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 543
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: functions for auto

Code:
          if (autoMethod == Defines.Autos.AUTO_GRAB_ONE_BIN_BLUE_SIDE) {
               return;
          } else if (autoMethod == Defines.Autos.AUTO_GRAB_ONE_BIN_RED_SIDE) {
               return;
          } else if (autoMethod == Defines.Autos.AUTO_MOVE_TO_ZONE) {
               return;
          } else if (autoMethod == Defines.Autos.AUTO_GRAB_TWO_BINS_RED_SIDE) {
               return;
          } else if (autoMethod == Defines.Autos.AUTO_GRAB_TWO_BINS_BLUE_SIDE) {
               return;
          }
this block of code does nothing. Not only does it check every single possible auto state (the entire block is equivalent to autoMethod != null), returning does nothing since there is no more code to be executed. So, all this code does is stall the processor for a few microseconds.

To call the turn() code, the "deg" argument will be the angle in reference to the gyro. So if the gyro has just been reset and you call turn(90), the robot will turn untill the gyro reads 90, which will be a 90 degree turn to the right(?). If you call turn(90) when the gyro hasn't been reset and the gyro is, for example 135, the gyro will turn 45 degrees to the left(?). Note that I wrote all of that code in the text editor and it hasn't come anywhere close to being tested.

Last edited by Arhowk : 21-02-2015 at 11:54.
Reply With Quote