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:
- 8:38db82c3492a
- Parent:
- 7:0e3a6da2e175
- Child:
- 9:6008a52fb6ef
diff -r 0e3a6da2e175 -r 38db82c3492a main.cpp
--- a/main.cpp Sat Jan 15 11:17:07 2022 +0000
+++ b/main.cpp Mon Jan 17 02:45:48 2022 +0000
@@ -15,12 +15,13 @@
PwmOut servo1(PB_8); //サーボ
PwmOut servo2(PB_9);
-//DigitalIn (dp16);
+DigitalIn limit(dp16);
int shoot_able;//発射フェーズ 0:待機 1:引き動作 2:リボルバー1/6回転 3:発射
int turn_able;//回転フェーズ 0:待機 1:1/6回転
double revolver_pwm = 0.1;//リボルバー回転速度
+double shoot_pwm = 0.1;//装填モーター速度
int theta = 500;//サーボ回転角度
double interval = 0.1;
int roricon = 0;
@@ -84,6 +85,9 @@
case 1:
//装填動作コードをここに書く!
+ while(limit.read() == 0){
+ motor_shoot.output(shoot_pwm);
+ }
shoot_able = 2;
printf("finished pulling\n");
wait(5);