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.
Fork of Timer by
Revision 45:b53ae54062c6, committed 2016-04-13
- Comitter:
- sype
- Date:
- Wed Apr 13 12:47:47 2016 +0000
- Parent:
- 44:b1fd7489369f
- Child:
- 46:5658af4e5149
- Child:
- 47:be4eebf40568
- Commit message:
- Impl?mentation des dispositifs finie
Changed in this revision
--- a/Functions/func.cpp Wed Apr 13 11:43:10 2016 +0000
+++ b/Functions/func.cpp Wed Apr 13 12:47:47 2016 +0000
@@ -145,4 +145,10 @@
EndR.fall(&ERpressed);
EndR.rise(&ERunpressed);
ticker.attach_us(&update_main,dt); // 100 Hz
+}
+
+void update_main(void)
+{
+ odo.update_odo();
+ checkAround();
}
\ No newline at end of file
--- a/Functions/func.h Wed Apr 13 11:43:10 2016 +0000 +++ b/Functions/func.h Wed Apr 13 12:47:47 2016 +0000 @@ -9,6 +9,7 @@ #include "AX12.h" #define SEUIL 0.25 +#define dt 10000 extern Serial logger; extern RoboClaw roboclaw; @@ -27,6 +28,8 @@ extern InterruptIn EndL; extern AX12 left_hand; extern AX12 right_hand; +extern Ticker ticker; +extern Odometry odo; extern int i, state; extern bool EL, EZ, ER; @@ -46,5 +49,6 @@ void init_interrupt(void); void goHome(void); void checkAround(void); +void update_main(void); #endif \ No newline at end of file
--- a/main.cpp Wed Apr 13 11:43:10 2016 +0000
+++ b/main.cpp Wed Apr 13 12:47:47 2016 +0000
@@ -1,6 +1,5 @@
#include "func.h"
-#define dt 10000
#define ATTENTE 0
#define GO 1
#define STOP 2
@@ -42,7 +41,6 @@
int i = 0, state = 0;
bool EL = false, EZ = false, ER = false;
-void update_main(void);
void init(void);
/* Debut du programme */
@@ -71,9 +69,3 @@
wait_ms(100);
logger.printf("End init\n\r");
}
-
-void update_main(void)
-{
- odo.update_odo();
- checkAround();
-}
\ No newline at end of file
