LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
adiGyro.hpp
Go to the documentation of this file.
1/*
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 */
6#pragma once
7
8#include "api.h"
11
12namespace okapi {
14 public:
27 ADIGyro(std::uint8_t iport, double imultiplier = 1);
28
46 ADIGyro(std::pair<std::uint8_t, std::uint8_t> iports, double imultiplier = 1);
47
53 double get() const override;
54
62 double getRemapped(double iupperBound = 1800, double ilowerBound = -1800) const;
63
69 std::int32_t reset() override;
70
77 double controllerGet() override;
78
79 protected:
80 pros::c::ext_adi_gyro_t gyro;
81};
82} // namespace okapi
PROS API header provides high-level user functionality.
ADIGyro(std::uint8_t iport, double imultiplier=1)
A gyroscope on the given ADI port.
double getRemapped(double iupperBound=1800, double ilowerBound=-1800) const
Get the current sensor value remapped into the target range ([-1800, 1800] by default).
pros::c::ext_adi_gyro_t gyro
Definition adiGyro.hpp:80
std::int32_t reset() override
Reset the sensor to zero.
double get() const override
Get the current sensor value.
ADIGyro(std::pair< std::uint8_t, std::uint8_t > iports, double imultiplier=1)
A gyroscope on the given ADI port.
double controllerGet() override
Get the sensor value for use in a control loop.