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:
- overkiller
- Date:
- 2015-09-21
- Revision:
- 7:baec885e57db
- Parent:
- 6:9eb153e1d472
File content as of revision 7:baec885e57db:
#include "mbed.h"
#include "include/EngineDriver.h"
#include "include/SerialPrompt.h"
#include "include/SR04.h"
Serial pc(USBTX, USBRX);
int initDrivingUnit(int testLoops)
{
pc.printf("Testing engines...\n\r");
enableAll();
int i = 0;
while(i < testLoops)
{
testEngines();
applyStates();
i++;
}
resetEngines();
enableAllButton.mode(PullDown);
return 0;
}
int main()
{
// if(initDrivingUnit(1) == 0)
// {
// pc.printf("Ready to accept commands.\n\r Netrunner will start moving in 1 second");
// displayPrompt(&pc);
// }
// wait(1);
while (true)
{
// checkEnableButtonState();
// displayMessage("clicks: %f", &pc, buttonClicks);
// int action = getMenuInput(&pc);
actualDistance = getDistance(0);
pc.printf("test\n");
pc.printf("%d", actualDistance);
wait(1);
// if(actualDistance <= 10)
// {
// resetEngines();
// }else
// {
// forward();
// }
// applyStates();
}
}