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

Dependencies:   PID QEI ikarashiMDC recieveController omni

hayatoBoomerang.h

Committer:
WAT34
Date:
2017-08-29
Revision:
4:c2b09fa31492
Parent:
2:aca690545ec9
Child:
6:0bee4b2bb400

File content as of revision 4:c2b09fa31492:

#ifndef HAYATOBOOMERANG_H
#define HAYATOBOOMERANG_H

#include "mbed.h"
#include "ikarashiMDC.h"
#include "PID.h"
#include "QEI.h"
#include "Spiral.h"
#include "pinConfig.h"

class boomerang
{
public:
  boomerang(Serial *serail_); // Create boomerang instance
  bool fire(); // Fire boomerang
  void setTargetMotorSpeed(const int& targetRPM);
  void setTargetArmAngle(const int& targetArmAngle); // 0 to 90
  int calibrateArm();
  void update();
  double motorRPM;
  double armAngle;
  bool calibrating;
  double beltSpeed;
  ikarashiMDC* armMotor,*shootingMotor,*beltMotor,*spiralMotor;
private:
  InterruptIn *speedEncoder;
  QEI *armEncoder;
  InterruptIn* armLimit;
  DigitalOut *rscs;
  PID *speedPID,*armPID;
  Timer rpmCalc;
  Timeout beltTime;
  Spiral* spiral;
  void endCalibration();
  void beltStop();
  bool firing;

  void shootingEncoderCount();


};


#endif /* end of include guard: HAYATOBOOMERANG_H */