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.
Dependents: ROCO104_Buggy BuggyDesign
Diff: clickers.cpp
- Revision:
- 1:d5b76569b45c
- Parent:
- 0:cfb1fcccadd6
- Child:
- 2:2571dd52276f
--- a/clickers.cpp Mon Feb 10 10:54:40 2020 +0000
+++ b/clickers.cpp Sat Feb 15 12:45:57 2020 +0000
@@ -1,16 +1,21 @@
#include "mbed.h"
#include "motor.h"
#include "clickers.h"
+#include "ultrasonic.h"
extern DigitalIn microswitch1; //Instance of the DigitalIn class called 'microswitch1'
extern DigitalIn microswitch2; //Instance of the DigitalIn class called 'microswitch2'
extern Motor Wheel;
+extern Serial pc;
+extern int mm;
+extern ultrasonic mu;
void RevStop()
{
- microswitch1.read();
- while (microswitch1 == true)
+ while (microswitch1 == true || mm <= 300)
{
+ pc.printf("%dmm\n\r", mm);
microswitch1.read();
+ mu.checkDistance();
Wheel.Stop();
}
}
\ No newline at end of file