2017ロボコンはやとブーメランプログラム

Dependencies:   PID QEI ikarashiMDC recieveController omni

Committer:
WAT34
Date:
Thu Aug 24 20:47:56 2017 +0900
Revision:
2:aca690545ec9
Parent:
1:35e874e10602
Child:
4:c2b09fa31492
working commit

Who changed what in which revision?

UserRevisionLine numberNew 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 1:35e874e10602 22 private:
WAT34 2:aca690545ec9 23 InterruptIn *speedEncoder;
WAT34 2:aca690545ec9 24 QEI *armEncoder;
WAT34 2:aca690545ec9 25 InterruptIn* armLimit;
WAT34 2:aca690545ec9 26 ikarashiMDC* armMotor,*shootingMotor,*beltMotor,*spiralMotor;
WAT34 2:aca690545ec9 27 DigitalOut *rscs;
WAT34 2:aca690545ec9 28 PID *speedPID,*armPID;
WAT34 1:35e874e10602 29 Timer rpmCalc;
WAT34 1:35e874e10602 30 Timeout beltTime;
WAT34 2:aca690545ec9 31 Spiral* spiral;
WAT34 2:aca690545ec9 32 void endCalibration();
WAT34 2:aca690545ec9 33 void beltStop();
WAT34 2:aca690545ec9 34
WAT34 2:aca690545ec9 35 void shootingEncoderCount();
WAT34 2:aca690545ec9 36
WAT34 1:35e874e10602 37
WAT34 1:35e874e10602 38 };
WAT34 1:35e874e10602 39
WAT34 1:35e874e10602 40
WAT34 1:35e874e10602 41 #endif /* end of include guard: HAYATOBOOMERANG_H */