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.
Diff: main.cpp
- Revision:
- 21:c6c33381fc5f
- Parent:
- 20:1d98a6f51dee
- Child:
- 22:000890b38b32
--- a/main.cpp Wed May 09 11:53:46 2018 +0000
+++ b/main.cpp Wed May 09 14:08:56 2018 +0000
@@ -1,3 +1,4 @@
+// LIBs ------------------------------------------------------------------------------------
#include "mbed.h"
// MACHINE SETUP ---------------------------------------------------------------------------
@@ -30,6 +31,7 @@
InterruptIn saveBtn(A5);
InterruptIn startBtn(D12);
+// switch to alternate between JOG and routine
DigitalIn botao(D11);
// variables definition
@@ -107,7 +109,7 @@
int exitSavedPointsLoop = 0;
int keepSavedPointsReload = 0;
-// prototype functions
+// PROTOTYPE FUNCTIONS -------------------------------------------------------------------------------
void setupPins();
void move(int pps, int x_dir, int y_dir, int z_dir, int x_step, int y_step, int z_step);
@@ -131,9 +133,7 @@
void printDistance(void);
-// MAIN PROGRAM ----------------------------------------------------------------
-
-int contador = 0;
+// MAIN PROGRAM ----------------------------------------------------------------------------------------------
int main(){
printf("\nStarting...\r\n");
@@ -142,6 +142,7 @@
enable = 0;
+ // interrupções de fim de curso
endX.fall(&endX_press);
endX.rise(&endX_release);
@@ -153,8 +154,12 @@
saveBtn.rise(&savePoint);
startBtn.rise(&startSavedPoints);
-
+
+ int contador = 0;
+
+ // loop de movimento
while(1){
+ // movimento em JOG e salvamento dos pontos
if(modeStatus){
autoReload = 0;
saved = 0;
@@ -240,8 +245,8 @@
}
}
+ // loop for executing saved points
while(1){
-
printf("\nStarting saved points\n\r");
// home
@@ -338,7 +343,7 @@
}
}
} else {
-
+ // specified routine
}
}
}