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
clickers.cpp
- Committer:
- jakesmart
- Date:
- 2020-03-06
- Revision:
- 2:2571dd52276f
- Parent:
- 1:d5b76569b45c
- Child:
- 3:91541ffdf9a5
File content as of revision 2:2571dd52276f:
#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 void dist();
extern bool rStopped, fStopped;
void RevStop()
{
while (microswitch1 == true)
{
microswitch1.read();
Wheel.Stop();
rStopped = true;
}
void FwdStop()
{
while (mm<= 500)
{
ultra_sonic_distance();
Wheel.Stop();
fStopped = true
dist();
}
}