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.
main.cpp
- Committer:
- CamJohnston
- Date:
- 2017-03-23
- Revision:
- 0:68efaf4d1fa6
File content as of revision 0:68efaf4d1fa6:
#include "mbed.h" AnalogIn Up(p16); AnalogIn Down(p17); AnalogIn Right(p18); AnalogIn Left(p19); DigitalOut RightUp(p24); DigitalOut RightDown(p23); DigitalOut LeftUp(p22); DigitalOut LeftDown(p21); int main() { while(1) { if (Up.read() > 0.83) { RightUp.write(1); RightDown.write(0); LeftUp.write(1); LeftDown.write(0); } if (Down.read() > 0.83) { RightUp.write(0); RightDown.write(1); LeftUp.write(0); LeftDown.write(1); } if (Right.read() > 0.83) { RightUp.write(0); RightDown.write(0); LeftUp.write(1); LeftDown.write(0); } if (Left.read() > 0.83) { RightUp.write(1); RightDown.write(0); LeftUp.write(0); LeftDown.write(0); } if (Left.read() < 0.83 & Right.read() < 0.83 & Down.read() < 0.83 & Up.read() < 0.83) { RightUp.write(0); RightDown.write(0); LeftUp.write(0); LeftDown.write(0); } } }