Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package ca.mcrobotics.subsystems;
import ca.mcrobotics.subsystems.*;
import com.analog.adis16470.frc.ADIS16470_IMU;
import edu.wpi.first.wpilibj.SPI;
import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj.command.Subsystem;
public class Location extends Subsystem{
public ADIS16470_IMU imu;
public Location(){
imu = new ADIS16470_IMU();
}
@Override
protected void initDefaultCommand(){
}
@Override
public void periodic(){
SmartDashboard.putNumber("Gyro Angle", imu.getAngle());
SmartDashboard.putNumber("Gyro Rate", imu.getRate());
//System.out.println("Gyro Angle: "+ imu.getAngleZ());
SmartDashboard.putNumber("Gyro-X", imu.getAngleX());
SmartDashboard.putNumber("Gyro-Y", imu.getAngleY());
SmartDashboard.putNumber("Gyro-Z", imu.getAngleZ());
//System.out.println("dt: "+ imu.getdt());
System.out.println(imu.getdt()+","+imu.getAngle()+";");
SmartDashboard.putNumber("dt", imu.getdt());
SmartDashboard.putNumber("Accel-X", imu.getAccelX());
SmartDashboard.putNumber("Accel-Y", imu.getAccelY());
SmartDashboard.putNumber("Accel-Z", imu.getAccelZ());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.