-
-
Save anonymous/908d630ea021e1c0dcff9b9997fc3d52 to your computer and use it in GitHub Desktop.
gyro issues
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*----------------------------------------------------------------------------*/ | |
/* Copyright (c) 2017 FIRST. All Rights Reserved. */ | |
/* Open Source Software - may be modified and shared by FRC teams. The code */ | |
/* must be accompanied by the FIRST BSD license file in the root directory of */ | |
/* the project. */ | |
/*----------------------------------------------------------------------------*/ | |
#include <iostream> | |
#include <string> | |
#include <IterativeRobot.h> | |
#include <LiveWindow/LiveWindow.h> | |
#include <SmartDashboard/SendableChooser.h> | |
#include <SmartDashboard/SmartDashboard.h> | |
#include "WPILib.h" | |
#include "ctre/Phoenix.h" | |
#include "DriverStation.h" | |
#include "Drive/DifferentialDrive.h" | |
#include <ADXRS450_Gyro.h> | |
class Robot: public IterativeRobot { | |
private: | |
Preferences * prefs; | |
LiveWindow *lw = LiveWindow::GetInstance(); | |
//drivers station | |
SmartDashboard *smart; | |
ADXRS450_Gyro *gyro; | |
void RobotInit() { | |
prefs = Preferences::GetInstance(); | |
gyro = new ADXRS450_Gyro(); | |
//gyro->Calibrate(); | |
} | |
void AutonomousInit() override { | |
} | |
void AutonomousPeriodic() { | |
} | |
void TeleopInit() { | |
} | |
void TeleopPeriodic() { | |
float testAngle2 = gyro->GetAngle(); | |
SmartDashboard::PutNumber("gyro test 2: ", testAngle2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment