shoot

Dependencies:   mbed SBDBT arrc_mbed Servo air

Files at this revision

API Documentation at this revision

Comitter:
asumamatsumura
Date:
Thu Feb 24 01:50:43 2022 +0000
Parent:
1:cae30876c429
Commit message:
servo;

Changed in this revision

Servo.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r cae30876c429 -r 0428390d7c90 Servo.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Servo.lib	Thu Feb 24 01:50:43 2022 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/simon/code/Servo/#36b69a7ced07
diff -r cae30876c429 -r 0428390d7c90 main.cpp
--- a/main.cpp	Mon Jan 24 08:11:10 2022 +0000
+++ b/main.cpp	Thu Feb 24 01:50:43 2022 +0000
@@ -1,9 +1,11 @@
 #include "mbed.h"
 #include "air.hpp"
 #include "sbdbt.hpp"
+#include "Servo.h"
 sbdbt ds3(A0, A1);
 DigitalIn limitA(PA_9,PullUp);
 Air hassya(PA_0);
+Servo myservo(PB_0);
 Timer timer;
 //↓モータ用
 void driveMotorS(double pwm){
@@ -24,8 +26,12 @@
 }
 // ↓サーボ用(未実装)
 void Servo(bool data){
-    
+    if(data==0){
+    myservo = 0;    
+    }else{
+    myservo = 0.2;
     }
+}
 //↓発射用
 void Hassya(bool data,int tim){
     if(data==1 || timer.read_ms()-tim<3000){