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
Diff: main.cpp
- Revision:
- 0:67dc92eb6d5f
- Child:
- 1:849b06ea572d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Nov 18 19:04:35 2016 +0000
@@ -0,0 +1,42 @@
+#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;
+}
+
+//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);
+ }
+}
