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: LSM9DS1_Library_cal Motordriver
main.cpp
- Committer:
- apcastelein
- Date:
- 2016-11-28
- Revision:
- 1:849b06ea572d
- Parent:
- 0:67dc92eb6d5f
- Child:
- 2:c91ce1f091f5
File content as of revision 1:849b06ea572d:
#include "mbed.h"
// Sends a request to the server and waits for a path response
char* getPathFromServer(){
//use wifi module here
//https://developer.mbed.org/users/electromotivated/notebook/wifi-pid-redbot-robot-webserver/
char* path = "";
return path;
}
//gets the orientation from imu
float getDirection(){}
//technologies for navigation may include
// - Line following https://www.sparkfun.com/products/11769
// - IMU https://developer.mbed.org/cookbook/Stinger-Robot-Library
// - color sensor (indicates when end of movement is reached)
void moveForward(){}
void rotateLeft(){}
void rotateRight(){}
//arem technology is yet to be determined, will probably involve adjusting a motor
void armUp(){}
void armDown(){}
// Loops through path commands and executes each one sequentially
void executePath(char* path){
int index = 0;
while(path[index] != '\0'){
switch(path[index]){
case 'F': moveForward(); break;
case 'L': rotateLeft(); break;
case 'R': rotateRight(); break;
case 'U': armUp(); break;
case 'U': armDown(); break;
}
}
}
int main() {
while(true){
char* path = getPathFromServer();
executePath(path);
}
}
