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
Functions/func.h@48:03da1aead032, 2016-04-28 (annotated)
- Committer:
- sype
- Date:
- Thu Apr 28 08:11:25 2016 +0000
- Revision:
- 48:03da1aead032
- Parent:
- 46:5658af4e5149
- Child:
- 49:5e2f7323f280
Int?gration de "l'algo" carte boutons, maintenant le bouton bleu (utilisateur) est remplac? par le jumper pr?sent sur la carte (on le retire pour d?marrer) et le changement de camp du robot se fait par le bouton pr?sent sur cette carte
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| sype | 41:b5a2fbc20beb | 1 | #ifndef FUNC_H |
| sype | 41:b5a2fbc20beb | 2 | #define FUNC_H |
| sype | 41:b5a2fbc20beb | 3 | |
| sype | 41:b5a2fbc20beb | 4 | #include "mbed.h" |
| sype | 41:b5a2fbc20beb | 5 | #include "../RoboClaw/RoboClaw.h" |
| sype | 41:b5a2fbc20beb | 6 | #include "../Odometry/Odometry.h" |
| sype | 41:b5a2fbc20beb | 7 | #include "../StepperMotor/Stepper.h" |
| sype | 41:b5a2fbc20beb | 8 | #include "Map/Map.h" |
| sype | 41:b5a2fbc20beb | 9 | #include "AX12.h" |
| sype | 41:b5a2fbc20beb | 10 | |
| sype | 41:b5a2fbc20beb | 11 | #define SEUIL 0.25 |
| sype | 48:03da1aead032 | 12 | #define VERT 1 |
| sype | 48:03da1aead032 | 13 | #define VIOLET 2 |
| sype | 48:03da1aead032 | 14 | #define ATTENTE 0 |
| sype | 48:03da1aead032 | 15 | #define GO 1 |
| sype | 48:03da1aead032 | 16 | #define STOP 2 |
| sype | 48:03da1aead032 | 17 | #define ADR 0x80 |
| sype | 48:03da1aead032 | 18 | #define dt 10000 |
| sype | 41:b5a2fbc20beb | 19 | |
| sype | 41:b5a2fbc20beb | 20 | extern Serial logger; |
| sype | 41:b5a2fbc20beb | 21 | extern RoboClaw roboclaw; |
| sype | 41:b5a2fbc20beb | 22 | extern DigitalOut bleu; |
| sype | 41:b5a2fbc20beb | 23 | extern DigitalOut blanc; |
| sype | 41:b5a2fbc20beb | 24 | extern DigitalOut rouge; |
| sype | 41:b5a2fbc20beb | 25 | extern Stepper RMot; |
| sype | 41:b5a2fbc20beb | 26 | extern Stepper ZMot; |
| sype | 41:b5a2fbc20beb | 27 | extern Stepper LMot; |
| sype | 41:b5a2fbc20beb | 28 | extern AnalogIn capt1; |
| sype | 41:b5a2fbc20beb | 29 | extern AnalogIn capt2; |
| sype | 41:b5a2fbc20beb | 30 | extern AnalogIn capt3; |
| sype | 44:b1fd7489369f | 31 | extern InterruptIn mybutton; |
| sype | 44:b1fd7489369f | 32 | extern InterruptIn EndR; |
| sype | 44:b1fd7489369f | 33 | extern InterruptIn EndZ; |
| sype | 44:b1fd7489369f | 34 | extern InterruptIn EndL; |
| sype | 48:03da1aead032 | 35 | //extern AX12 left_hand; |
| sype | 48:03da1aead032 | 36 | //extern AX12 right_hand; |
| sype | 45:b53ae54062c6 | 37 | extern Odometry odo; |
| sype | 48:03da1aead032 | 38 | extern Ticker ticker; |
| sype | 46:5658af4e5149 | 39 | extern InterruptIn CAMP; |
| sype | 46:5658af4e5149 | 40 | extern InterruptIn START; |
| sype | 46:5658af4e5149 | 41 | extern DigitalOut LEDR; |
| sype | 46:5658af4e5149 | 42 | extern DigitalOut LEDV; |
| sype | 41:b5a2fbc20beb | 43 | |
| sype | 48:03da1aead032 | 44 | |
| sype | 48:03da1aead032 | 45 | extern int SIMON_i, SIMON_state, SCouleur, SStart; |
| sype | 46:5658af4e5149 | 46 | extern bool SIMON_EL, SIMON_EZ, SIMON_ER; |
| sype | 41:b5a2fbc20beb | 47 | |
| sype | 46:5658af4e5149 | 48 | void changeCamp(void); |
| sype | 48:03da1aead032 | 49 | void go(void); |
| sype | 41:b5a2fbc20beb | 50 | void ELpressed(void); |
| sype | 41:b5a2fbc20beb | 51 | void ELunpressed(void); |
| sype | 41:b5a2fbc20beb | 52 | void EZpressed(void); |
| sype | 41:b5a2fbc20beb | 53 | void EZunpressed(void); |
| sype | 41:b5a2fbc20beb | 54 | void ERpressed(void); |
| sype | 41:b5a2fbc20beb | 55 | void ERunpressed(void); |
| sype | 41:b5a2fbc20beb | 56 | |
| sype | 41:b5a2fbc20beb | 57 | void pressed(void); |
| sype | 41:b5a2fbc20beb | 58 | void unpressed(void); |
| sype | 41:b5a2fbc20beb | 59 | void JPO(void); |
| sype | 41:b5a2fbc20beb | 60 | |
| sype | 41:b5a2fbc20beb | 61 | void init_ax12(void); |
| sype | 44:b1fd7489369f | 62 | void init_interrupt(void); |
| sype | 41:b5a2fbc20beb | 63 | void goHome(void); |
| sype | 41:b5a2fbc20beb | 64 | void checkAround(void); |
| sype | 48:03da1aead032 | 65 | void update_main(void); |
| sype | 41:b5a2fbc20beb | 66 | |
| sype | 41:b5a2fbc20beb | 67 | #endif |
