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:
- 13:93321c73df60
- Parent:
- 12:1a22b9797004
- Child:
- 14:ab89b6cd9719
--- a/main.cpp Wed Oct 10 12:33:40 2018 +0000
+++ b/main.cpp Wed Oct 10 16:58:39 2018 +0000
@@ -81,7 +81,7 @@
#define high_table 5
//2段低最小距離
-#define low_grade_minimum_distance 7
+#define low_grade_minimum_distance 4
//2段低最大距離
#define low_grade_maximum_distance 16
@@ -1465,9 +1465,8 @@
myled4 = 0;
}
- /*
//6発発射したら弾倉切り替え
- if(mouted_bottles == 6) {
+ if(mouted_bottles == 10) {
if(photo_interrupter == 0) {
loading_data[0] = 0x0C;
i2c.write(0x30, loading_data, 1, false);
@@ -1476,7 +1475,6 @@
i2c.write(0x30, loading_data, 1, false);
}
}
- */
//pc.printf("%3d %3d %3d %3d %3d %3d\n\r", front_line_state, back_line_state, line_state_pettern, abs(measure_pulse), distance, mouted_bottles);
//pc.printf("%d %3lf\n\r", mouted_bottles, timer.read());
@@ -1516,8 +1514,8 @@
//発射距離に到達して1秒待って発射
if(timer.read() > 1.0f && timer.read() <= 2.5f) {
cylinder_data[0] = 5;
+ mouted_bottles = 5;
i2c.write(0x40, cylinder_data, 1);
- mouted_bottles++;
}
else if(timer.read() > 12.5f && timer.read() <= 15.0f) {
cylinder_data[0] = 0x80;
@@ -1529,8 +1527,8 @@
else if(timer.read() > 15.5f && timer.read() <= 17.5f) {
line_state_pettern = stop;
cylinder_data[0] = 5;
+ mouted_bottles = 10;
i2c.write(0x40, cylinder_data, 1);
- mouted_bottles++;
}
else if(timer.read() > 28.0f && timer.read() <= 30.0f) {
line_state_pettern = stop;
@@ -1543,8 +1541,8 @@
else if(timer.read() > 31.0f && timer.read() <= 33.0f) {
line_state_pettern = stop;
cylinder_data[0] = 5;
+ mouted_bottles = 15;
i2c.write(0x40, cylinder_data, 1);
- mouted_bottles++;
}
else if(timer.read() > 33.0f && timer.read() <= 43.0f) {
line_state_pettern = stop;