2017ロボコンはやとブーメランプログラム
Dependencies: PID QEI ikarashiMDC recieveController omni
hayatoBoomerang.h@4:c2b09fa31492, 2017-08-29 (annotated)
- Committer:
- WAT34
- Date:
- Tue Aug 29 17:00:05 2017 +0900
- Revision:
- 4:c2b09fa31492
- Parent:
- 2:aca690545ec9
- Child:
- 6:0bee4b2bb400
debugs
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
WAT34 | 1:35e874e10602 | 1 | #ifndef HAYATOBOOMERANG_H |
WAT34 | 1:35e874e10602 | 2 | #define HAYATOBOOMERANG_H |
WAT34 | 1:35e874e10602 | 3 | |
WAT34 | 1:35e874e10602 | 4 | #include "mbed.h" |
WAT34 | 1:35e874e10602 | 5 | #include "ikarashiMDC.h" |
WAT34 | 1:35e874e10602 | 6 | #include "PID.h" |
WAT34 | 1:35e874e10602 | 7 | #include "QEI.h" |
WAT34 | 2:aca690545ec9 | 8 | #include "Spiral.h" |
WAT34 | 2:aca690545ec9 | 9 | #include "pinConfig.h" |
WAT34 | 1:35e874e10602 | 10 | |
WAT34 | 1:35e874e10602 | 11 | class boomerang |
WAT34 | 1:35e874e10602 | 12 | { |
WAT34 | 1:35e874e10602 | 13 | public: |
WAT34 | 1:35e874e10602 | 14 | boomerang(Serial *serail_); // Create boomerang instance |
WAT34 | 1:35e874e10602 | 15 | bool fire(); // Fire boomerang |
WAT34 | 1:35e874e10602 | 16 | void setTargetMotorSpeed(const int& targetRPM); |
WAT34 | 1:35e874e10602 | 17 | void setTargetArmAngle(const int& targetArmAngle); // 0 to 90 |
WAT34 | 1:35e874e10602 | 18 | int calibrateArm(); |
WAT34 | 2:aca690545ec9 | 19 | void update(); |
WAT34 | 1:35e874e10602 | 20 | double motorRPM; |
WAT34 | 1:35e874e10602 | 21 | double armAngle; |
WAT34 | 4:c2b09fa31492 | 22 | bool calibrating; |
WAT34 | 4:c2b09fa31492 | 23 | double beltSpeed; |
WAT34 | 4:c2b09fa31492 | 24 | ikarashiMDC* armMotor,*shootingMotor,*beltMotor,*spiralMotor; |
WAT34 | 1:35e874e10602 | 25 | private: |
WAT34 | 2:aca690545ec9 | 26 | InterruptIn *speedEncoder; |
WAT34 | 2:aca690545ec9 | 27 | QEI *armEncoder; |
WAT34 | 2:aca690545ec9 | 28 | InterruptIn* armLimit; |
WAT34 | 2:aca690545ec9 | 29 | DigitalOut *rscs; |
WAT34 | 2:aca690545ec9 | 30 | PID *speedPID,*armPID; |
WAT34 | 1:35e874e10602 | 31 | Timer rpmCalc; |
WAT34 | 1:35e874e10602 | 32 | Timeout beltTime; |
WAT34 | 2:aca690545ec9 | 33 | Spiral* spiral; |
WAT34 | 2:aca690545ec9 | 34 | void endCalibration(); |
WAT34 | 2:aca690545ec9 | 35 | void beltStop(); |
WAT34 | 4:c2b09fa31492 | 36 | bool firing; |
WAT34 | 2:aca690545ec9 | 37 | |
WAT34 | 2:aca690545ec9 | 38 | void shootingEncoderCount(); |
WAT34 | 2:aca690545ec9 | 39 | |
WAT34 | 1:35e874e10602 | 40 | |
WAT34 | 1:35e874e10602 | 41 | }; |
WAT34 | 1:35e874e10602 | 42 | |
WAT34 | 1:35e874e10602 | 43 | |
WAT34 | 1:35e874e10602 | 44 | #endif /* end of include guard: HAYATOBOOMERANG_H */ |