From 2c5ae300b4b7fc8779950a096bc16b1df20156ac Mon Sep 17 00:00:00 2001 From: "Keenan D. Buckley" Date: Fri, 27 Mar 2020 13:44:10 -0600 Subject: [PATCH] Example Usage of getRobotGyro If you need to access an object from outside the subsystem, you should do this. --- src/main/java/frc4388/robot/subsystems/Drive.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/frc4388/robot/subsystems/Drive.java b/src/main/java/frc4388/robot/subsystems/Drive.java index 3323992..6252eba 100644 --- a/src/main/java/frc4388/robot/subsystems/Drive.java +++ b/src/main/java/frc4388/robot/subsystems/Drive.java @@ -84,9 +84,9 @@ public class Drive extends SubsystemBase { private void updateSmartDashboard() { // Examples of the functionality of RobotGyro - SmartDashboard.putBoolean("Is Gyro a Pigeon?", m_gyro.m_isGyroAPigeon); - SmartDashboard.putNumber("Turn Rate", m_gyro.getRate()); - SmartDashboard.putNumber("Gyro Pitch", m_gyro.getPitch()); - SmartDashboard.putData(m_gyro); + SmartDashboard.putBoolean("Is Gyro a Pigeon?", getRobotGyro().m_isGyroAPigeon); + SmartDashboard.putNumber("Turn Rate", getRobotGyro().getRate()); + SmartDashboard.putNumber("Gyro Pitch", getRobotGyro().getPitch()); + SmartDashboard.putData(getRobotGyro()); } }