DeepSpace  2019
Leg.h
Go to the documentation of this file.
1 #ifndef _LEG_HG_
2 #define _LEG_HG_
3 
4 #include <frc/commands/Subsystem.h>
5 #include <frc/DigitalInput.h>
6 #include <frc/WPILib.h>
7 #include <ctre/Phoenix.h>
8 #include "RobotMap.h"
9 
10 class Leg : public frc::Subsystem {
11 public:
15  Leg(void);
16 
20  void InitDefaultCommand() override;
21 
27  void MoveLeg(double Speed);
28 
34  bool AtTop(void) ;
35 
41  bool AtMiddle(void) ;
42 
48  bool AtBottom(void) ;
49 
50 private:
51 
57  can::WPI_TalonSRX* pLegMotor;
58 
65  frc::DigitalInput* pTopHall ;
66 
71  frc::DigitalInput* pMiddleHall ;
72 
78  frc::DigitalInput* pBottomHall ;
79 
80 };
81 
82 #endif // _LEG_HG_
void MoveLeg(double Speed)
Move climb leg up or down.
Definition: Leg.cpp:23
frc::DigitalInput * pMiddleHall
Sensor for when the leg is at the middle position If this sensor is tripped, the robot is above the l...
Definition: Leg.h:71
bool AtBottom(void)
Returns whether the legs are at the bottom most position.
Definition: Leg.cpp:42
frc::DigitalInput * pBottomHall
Sensor for when the leg is as far down as it can go If this sensor is tripped, the robot is above the...
Definition: Leg.h:78
bool AtMiddle(void)
Returns whether the legs are at the middle position.
Definition: Leg.cpp:37
Definition: Leg.h:10
Leg(void)
Construct a new Leg object.
Definition: Leg.cpp:3
frc::DigitalInput * pTopHall
Sensor for when the leg is as far up as it can go If this sensor is tripped, the legs are above the w...
Definition: Leg.h:65
can::WPI_TalonSRX * pLegMotor
Pointer for the climb leg motor Works off a winch system to pull up and down But is used like a talon...
Definition: Leg.h:57
void InitDefaultCommand() override
Who uses this? You dont need to.
Definition: Leg.cpp:18
bool AtTop(void)
Returns whether the legs are at the top most position.
Definition: Leg.cpp:32