Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 7:0e3a6da2e175
- Parent:
- 6:7dcc827bbe96
- Child:
- 8:38db82c3492a
diff -r 7dcc827bbe96 -r 0e3a6da2e175 main.cpp
--- a/main.cpp Fri Jan 14 15:12:45 2022 +0000
+++ b/main.cpp Sat Jan 15 11:17:07 2022 +0000
@@ -15,6 +15,8 @@
PwmOut servo1(PB_8); //サーボ
PwmOut servo2(PB_9);
+//DigitalIn (dp16);
+
int shoot_able;//発射フェーズ 0:待機 1:引き動作 2:リボルバー1/6回転 3:発射
int turn_able;//回転フェーズ 0:待機 1:1/6回転
@@ -65,8 +67,8 @@
int main(){
int count = 1;//何発目か
- servo.period_us(20000);
- servo.period_us(20000);
+ servo1.period_us(20000);
+ servo2.period_us(20000);
slave.addCMD(2,interrupt);
while(1){
@@ -84,6 +86,7 @@
//装填動作コードをここに書く!
shoot_able = 2;
printf("finished pulling\n");
+ wait(5);
break;
case 2:
@@ -105,7 +108,6 @@
shoot_able = 0;
printf("finished shooting %d\n",count);
count ++;
- wait(5);
servo1.pulsewidth_us(0);
servo2.pulsewidth_us(0);
break;