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

Dependencies:   PID QEI ikarashiMDC recieveController omni

main.cpp

Committer:
WAT34
Date:
2017-08-29
Revision:
4:c2b09fa31492
Parent:
2:aca690545ec9
Child:
5:9c52e6c14c87

File content as of revision 4:c2b09fa31492:

#include "mbed.h"
#include "hayatoBoomerang.h"

Serial rs485(PC_10,PC_11,38400);
//Serial serial(USBTX,USBRX);
PwmOut led(LED1);
DigitalIn button(BUTTON1);
boomerang boom(&rs485);
Thread commThread;

typedef struct {
  char data[4];
} mail_t;

void init()
{
  button.mode(PullUp);

  //boom.calibrateArm();
  boom.setTargetMotorSpeed(0);
  boom.setTargetArmAngle(10);
}


int main() {
  init();
  double i = -1;
  while(true)
  {
    if(!button)
      boom.fire();
    boom.update();
    led = boom.beltSpeed;
    wait_ms(10);
    // boom.beltSpeed = i;
    // boom.update();
    // i += 0.01;
    // wait_ms(10);
    // if(i > 1) i = -1;

  }

}