2015-01-16 19:29:55 -05:00
|
|
|
#ifndef ELEVATOR_H
|
|
|
|
#define ELEVATOR_H
|
|
|
|
|
|
|
|
#include "WPILib.h"
|
2015-03-09 09:48:18 -04:00
|
|
|
/**
|
|
|
|
* @brief The main elevator for lifting totes
|
|
|
|
*/
|
2015-02-07 13:08:24 -05:00
|
|
|
class Elevator{
|
2015-01-16 20:12:48 -05:00
|
|
|
private:
|
2015-03-09 09:48:18 -04:00
|
|
|
CANTalon *motor; //<! The elevator motor
|
|
|
|
Encoder *elevatorEncoder; //<! The elevator encoder (unused)
|
|
|
|
DigitalInput *elevatorBottom, //<! The bottom elevator sensor
|
|
|
|
*elevatorMiddle, //<! The middle elevator sensor
|
|
|
|
*elevatorTop; //<! The top elevator sensor
|
|
|
|
bool useEncoder; //<! Use the elevator enoder (unused)
|
2015-01-16 20:12:48 -05:00
|
|
|
public:
|
2015-03-09 09:48:18 -04:00
|
|
|
/**
|
|
|
|
* @brief Constructs Elevator
|
|
|
|
*/
|
2015-01-16 20:12:48 -05:00
|
|
|
Elevator();
|
2015-03-09 09:48:18 -04:00
|
|
|
/**
|
|
|
|
* @brief No action
|
|
|
|
*/
|
2015-01-16 20:12:48 -05:00
|
|
|
void InitDefaultCommand();
|
2015-03-09 09:48:18 -04:00
|
|
|
/**
|
|
|
|
* @brief Runs the elevator
|
|
|
|
*
|
|
|
|
* @param double The power to run the bin elevator (-1.0 to 1.0)
|
|
|
|
*/
|
2015-01-16 20:46:58 -05:00
|
|
|
void Run(double);
|
2015-03-09 09:48:18 -04:00
|
|
|
/**
|
|
|
|
* @brief Sets the encoder value to 0 (unused)
|
|
|
|
*/
|
2015-02-02 12:42:18 -05:00
|
|
|
void ResetEncoder();
|
2015-03-09 09:48:18 -04:00
|
|
|
/**
|
|
|
|
* @brief Gets the height of the elevtor
|
|
|
|
*
|
|
|
|
* @return The hight of the elevator
|
|
|
|
*/
|
2015-01-31 12:16:02 -05:00
|
|
|
double GetHeight();
|
2015-03-09 09:48:18 -04:00
|
|
|
/**
|
|
|
|
* @brief Gets the status of the top sensor
|
|
|
|
*
|
|
|
|
* @return True if the sensor is activated
|
|
|
|
*/
|
2015-02-07 13:03:00 -05:00
|
|
|
bool GetElevatorTop();
|
2015-03-09 09:48:18 -04:00
|
|
|
/**
|
|
|
|
* @brief Gets the status of the middle sensor
|
|
|
|
*
|
|
|
|
* @return True if the sensor is activated
|
|
|
|
*/
|
2015-02-15 07:53:19 -05:00
|
|
|
bool GetElevatorMiddle();
|
2015-03-09 09:48:18 -04:00
|
|
|
/**
|
|
|
|
* @brief Gets the status of the bottom sensor
|
|
|
|
*
|
|
|
|
* @return True if the sensor is activated
|
|
|
|
*/
|
2015-02-07 13:03:00 -05:00
|
|
|
bool GetElevatorBottom();
|
2015-03-09 09:48:18 -04:00
|
|
|
/**
|
|
|
|
* @brief Use the elevator encoder (unused)
|
|
|
|
*
|
|
|
|
* @param bool State to use encoder
|
|
|
|
*/
|
2015-02-12 21:18:48 -05:00
|
|
|
void SetUseEncoder(bool);
|
2015-03-09 09:48:18 -04:00
|
|
|
/**
|
|
|
|
* @brief Gets the state of useEncoder (unused)
|
|
|
|
*
|
|
|
|
* @return State of useEncoder
|
|
|
|
*/
|
2015-02-12 21:18:48 -05:00
|
|
|
bool GetUseEncoder();
|
2015-01-16 19:29:55 -05:00
|
|
|
};
|
|
|
|
#endif
|
2015-02-08 12:26:15 -05:00
|
|
|
// vim: ts=2:sw=2:et
|