Skip to content

Instantly share code, notes, and snippets.

/robot.cpp Secret

Created February 17, 2018 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/908d630ea021e1c0dcff9b9997fc3d52 to your computer and use it in GitHub Desktop.
Save anonymous/908d630ea021e1c0dcff9b9997fc3d52 to your computer and use it in GitHub Desktop.
gyro issues
/*----------------------------------------------------------------------------*/
/* 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