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.
Dependencies: mbed ADS1115 StepperMotor SRF05 TPA81new
Revision 9:ba07c0b8899f, committed 2018-02-16
- Comitter:
- Ezeuz
- Date:
- Fri Feb 16 12:36:40 2018 +0000
- Parent:
- 8:5e1854c119ba
- Child:
- 10:8722053fb75c
- Commit message:
- Small
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Feb 13 16:29:00 2018 +0000
+++ b/main.cpp Fri Feb 16 12:36:40 2018 +0000
@@ -68,7 +68,7 @@
float ir_o = 0;
float snd_o = 0;
float uv_o = 0;
- int ext = 0; // Extinguisher state
+ int ext = 1; // Extinguisher state
int tcal = 0; // Toggle calibration
int fcal = 0; // Force calibration
@@ -89,6 +89,12 @@
int16_t mx,my,mz;
cmp.reset();
+ // Motor switching test
+ m2 = 0;
+ m1 = 0;
+
+ wait(1);
+
while (1) {
// LCD
lcd.printf("%.1f L%.2f|%.2f\n", ir_o, line1_o, line2_o);
@@ -107,7 +113,6 @@
// Extinguisher (12V output)
m2 = ext;
m1 = ext;
- ext = !ext; // Switching test
// LED
led1 = 1;
@@ -157,6 +162,10 @@
pc.printf("Compass Calib\n");
fcal = !fcal;
break;
+ case 'm':
+ pc.printf("Motor toggle\n");
+ ext = !ext;
+ break;
}
// pc.putc(ser_i); // Display serial input
}