|
5 | 5 | /* the project. */
|
6 | 6 | /*----------------------------------------------------------------------------*/
|
7 | 7 |
|
8 |
| -/* |
9 |
| -XBox |
10 |
| -Axis: |
11 |
| -Left Stick X = 1 |
12 |
| -Left Stick Y = 2 |
13 |
| -Left Trigger = 3 |
14 |
| -Right Trigger = 4 |
15 |
| -Right Stick X = 5 |
16 |
| -Right Stick Y = 6 |
17 |
| - |
18 |
| -Button: |
19 |
| -A = 1 |
20 |
| -B = 2 |
21 |
| -X = 3 |
22 |
| -Y = 4 |
23 |
| -Left Trigger = 5 |
24 |
| -Right Trigger = 6 |
25 |
| -Options? = 7 |
26 |
| -Start? = 8 |
27 |
| -Left Stick = 9 |
28 |
| -Right Stick = 10 |
29 |
| -*/ |
30 | 8 | #include <frc/Joystick.h>
|
31 | 9 | #include <frc/TimedRobot.h>
|
32 | 10 | #include <frc/PWMVictorSPX.h>
|
@@ -159,57 +137,3 @@ class Robot : public frc::TimedRobot {
|
159 | 137 | #ifndef RUNNING_FRC_TESTS
|
160 | 138 | int main() { return frc::StartRobot<Robot>(); }
|
161 | 139 | #endif
|
162 |
| -/* |
163 |
| -#include <frc/Joystick.h> |
164 |
| -#include <frc/PWMVictorSPX.h> |
165 |
| -#include <frc/TimedRobot.h> |
166 |
| -#include <frc/Timer.h> |
167 |
| -#include <frc/drive/DifferentialDrive.h> |
168 |
| -#include <frc/livewindow/LiveWindow.h> |
169 |
| -#include <frc/SpeedControllerGroup.h> |
170 |
| -#include <frc/DoubleSolenoid.h> |
171 |
| -#include <frc/Solenoid.h> |
172 |
| -#include <frc/Encoder.h> |
173 |
| -#include <frc/smartdashboard/SmartDashboard.h> |
174 |
| - |
175 |
| -class Robot : public frc::TimedRobot { |
176 |
| - public: |
177 |
| - Robot() { |
178 |
| - forkLiftEncoder.SetSamplesToAverage(5); |
179 |
| - //Assuming 1 rotation = 100 cm and 1024 pulses per revolution |
180 |
| - forkLiftEncoder.SetDistancePerPulse(100/1024); |
181 |
| - forkLiftEncoder.SetMinRate(0); |
182 |
| - //Time in seconds before considered stop (i think??) |
183 |
| - forkLiftEncoder.SetMaxPeriod(1000.0); |
184 |
| - } |
185 |
| - void teleopInit() override { |
186 |
| - |
187 |
| - }; |
188 |
| - |
189 |
| - void teleopPeriodic() override{ |
190 |
| - if (gamePad.GetRawButton(0) == True) { |
191 |
| - while (forkLiftEncoder.GetDistance > 5) { |
192 |
| - m_forkLift.Set(.5); |
193 |
| - } |
194 |
| - } else if (gamePad.GetRawButton(0) == False){ |
195 |
| - while (forkLiftEncoder.GetDistance < 0) { |
196 |
| - m_forkLift.Set(-.5); |
197 |
| - } |
198 |
| - } |
199 |
| - // Retrieve the displacement of first the Encoder |
200 |
| - frc::SmartDashboard::PutNumber("Encoder1 Distance: ", encoder1.GetDistance()); |
201 |
| - |
202 |
| - // Retrieve the current rate of the first encoder. |
203 |
| - // Rate = DistancePerPulse/Period |
204 |
| - frc::SmartDashboard::PutNumber("Encoder1 Rate cm/s: ", encoder1.GetRate()); |
205 |
| - }; |
206 |
| - private: |
207 |
| - frc::Joystick gamePad{0}; |
208 |
| - frc::Encoder forkLiftEncoder{0, 1, false, frc::Encoder::k4X}; |
209 |
| - frc::PWMVictorSPX m_forkLift{4}; |
210 |
| -}; |
211 |
| - |
212 |
| -#ifndef RUNNING_FRC_TESTS |
213 |
| -int main() { return frc::StartRobot<Robot>(); } |
214 |
| -#endif |
215 |
| -*/ |
0 commit comments