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: BCEmotor Battery_Linear_Actuator Controller_ IMU_code_ LTC1298_7_14 MODSERIAL PosVelFilter_7_14 System mbed
Fork of 7_20_17_FSG_ by
Diff: main.cpp
- Revision:
- 2:c3cb3ea3c9fa
- Parent:
- 0:381a84fad08b
- Child:
- 3:1257a7d2eb3a
--- a/main.cpp Fri Jun 09 17:36:25 2017 +0000
+++ b/main.cpp Tue Jun 13 17:23:06 2017 +0000
@@ -32,6 +32,7 @@
DigitalOut enab(p9); // a/d converter enable
AnalogIn pressure_analog_in(A5); //Initialize pin20 (read is float value)
+AnalogIn ain(p18);
/* ************ These tickers work independent of any while loops ********** */
Ticker IMU_ticker; //ticker for printing IMU //https://developer.mbed.org/handbook/Ticker
@@ -75,7 +76,7 @@
hBridge().stop();
//start up the system timer so the position velocity estimator has a time signal
systemTime().start();
- enab=1;
+ //enab=1;
//setup and start the adc. This runs on a fixed interval and is interrupt driven
adc().initialize();
adc().start();
@@ -269,6 +270,12 @@
}
}
+ else if ((5.0*ain.read())<1.0)
+ {
+ pc().printf("Hit the limit switch??\n");
+ hBridge().stop();
+ }
+
//string snaps
else if (pvf().getVelocity() > 100)
{
