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

Dependencies:   PID QEI ikarashiMDC recieveController omni

Revision:
4:c2b09fa31492
Parent:
2:aca690545ec9
Child:
5:9c52e6c14c87
--- a/main.cpp	Thu Aug 24 20:51:12 2017 +0900
+++ b/main.cpp	Tue Aug 29 17:00:05 2017 +0900
@@ -1,8 +1,43 @@
 #include "mbed.h"
-#include "pinConfig.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() {
-  return 0;
+  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;
+
+  }
+
 }