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: mbed bloc_8_pompe2 Herkulex_library_2022 ident_crac1 bloc_pompe2
Action_bras/actions.cpp@2:c7f2e7d8b305, 2022-03-08 (annotated)
- Committer:
- ares1999
- Date:
- Tue Mar 08 16:03:27 2022 +0000
- Revision:
- 2:c7f2e7d8b305
- Child:
- 3:77e937c315f1
t
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| ares1999 | 2:c7f2e7d8b305 | 1 | #include "actions.h" |
| ares1999 | 2:c7f2e7d8b305 | 2 | |
| ares1999 | 2:c7f2e7d8b305 | 3 | uint8_t servos_bras_testeur[2] = {RLED_ON, 1}; |
| ares1999 | 2:c7f2e7d8b305 | 4 | uint16_t pos_testeur[1] = {400}; |
| ares1999 | 2:c7f2e7d8b305 | 5 | |
| ares1999 | 2:c7f2e7d8b305 | 6 | void fct_opti(void) |
| ares1999 | 2:c7f2e7d8b305 | 7 | { |
| ares1999 | 2:c7f2e7d8b305 | 8 | //positionControl_Mul_ensemble_complex(1, 60, servos_bras_testeur, pos_testeur, SERIAL_BAS_DROITE); |
| ares1999 | 2:c7f2e7d8b305 | 9 | //(uint8_t nb_servo, uint8_t playtime, uint8_t* data, uint16_t* pos, uint8_t numero_serial) // uint16_t position, uint8_t setLED, uint8_t id |
| ares1999 | 2:c7f2e7d8b305 | 10 | //wait_ms(3000); |
| ares1999 | 2:c7f2e7d8b305 | 11 | positionControl(AR_HAUT, 750, PLAYTIME, GLED_ON, SERIAL_BAS_DROITE); |
| ares1999 | 2:c7f2e7d8b305 | 12 | positionControl_Mul_ensemble(AR_BASE, 1000, PLAYTIME, GLED_ON, AR_MILIEU, 160, GLED_ON, SERIAL_BAS_DROITE); |
| ares1999 | 2:c7f2e7d8b305 | 13 | wait_ms(TEMPO_LONGUE); |
| ares1999 | 2:c7f2e7d8b305 | 14 | positionControl(AR_HAUT, 650, PLAYTIME, GLED_ON, SERIAL_BAS_DROITE); |
| ares1999 | 2:c7f2e7d8b305 | 15 | positionControl_Mul_ensemble(AR_BASE, 500, PLAYTIME, GLED_ON, AR_MILIEU, 600, GLED_ON, SERIAL_BAS_DROITE); |
| ares1999 | 2:c7f2e7d8b305 | 16 | wait_ms(TEMPO_LONGUE); |
| ares1999 | 2:c7f2e7d8b305 | 17 | } |
| ares1999 | 2:c7f2e7d8b305 | 18 | |
| ares1999 | 2:c7f2e7d8b305 | 19 | void fct_prise_avant(char serial_select) |
| ares1999 | 2:c7f2e7d8b305 | 20 | { |
| ares1999 | 2:c7f2e7d8b305 | 21 | //Rangement |
| ares1999 | 2:c7f2e7d8b305 | 22 | positionControl_Mul_ensemble(AV_BASE, 1000, PLAYTIME, RLED_ON, AV_MILIEU, 160, RLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 23 | positionControl(AV_HAUT, 750, PLAYTIME, RLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 24 | wait_ms(2000); |
| ares1999 | 2:c7f2e7d8b305 | 25 | //Pré Prise |
| ares1999 | 2:c7f2e7d8b305 | 26 | positionControl(AV_HAUT, 650, PLAYTIME, GLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 27 | positionControl_Mul_ensemble(AV_BASE, 500, PLAYTIME, GLED_ON, AV_MILIEU, 600, GLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 28 | wait_ms(TEMPO_LONGUE); |
| ares1999 | 2:c7f2e7d8b305 | 29 | //Prise |
| ares1999 | 2:c7f2e7d8b305 | 30 | positionControl(AV_HAUT, 685, PLAYTIME, GLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 31 | positionControl_Mul_ensemble(AV_BASE, 445, PLAYTIME, GLED_ON, AV_MILIEU, 590, GLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 32 | wait_ms(TEMPO_LONGUE); |
| ares1999 | 2:c7f2e7d8b305 | 33 | //Rangement echantillon |
| ares1999 | 2:c7f2e7d8b305 | 34 | positionControl_Mul_ensemble(AV_BASE, 1000, PLAYTIME, BLED_ON, AV_MILIEU, 160, BLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 35 | positionControl(AV_HAUT, 510, PLAYTIME, BLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 36 | wait_ms(3000); |
| ares1999 | 2:c7f2e7d8b305 | 37 | } |
| ares1999 | 2:c7f2e7d8b305 | 38 | |
| ares1999 | 2:c7f2e7d8b305 | 39 | void fct_prise_arriere(char serial_select) |
| ares1999 | 2:c7f2e7d8b305 | 40 | { |
| ares1999 | 2:c7f2e7d8b305 | 41 | //Rangement |
| ares1999 | 2:c7f2e7d8b305 | 42 | positionControl_Mul_ensemble(AR_BASE, 1000, PLAYTIME, RLED_ON, AR_MILIEU, 160, RLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 43 | positionControl(AR_HAUT, 750, PLAYTIME, RLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 44 | wait_ms(2000); |
| ares1999 | 2:c7f2e7d8b305 | 45 | //Pré Prise |
| ares1999 | 2:c7f2e7d8b305 | 46 | positionControl(AR_HAUT, 650, PLAYTIME, GLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 47 | positionControl_Mul_ensemble(AR_BASE, 500, PLAYTIME, GLED_ON, AR_MILIEU, 600, GLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 48 | wait_ms(TEMPO_LONGUE); |
| ares1999 | 2:c7f2e7d8b305 | 49 | //Prise |
| ares1999 | 2:c7f2e7d8b305 | 50 | positionControl(AR_HAUT, 685, PLAYTIME, GLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 51 | positionControl_Mul_ensemble(AR_BASE, 445, PLAYTIME, GLED_ON, AR_MILIEU, 590, GLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 52 | wait_ms(TEMPO_LONGUE); |
| ares1999 | 2:c7f2e7d8b305 | 53 | //Rangement echantillon |
| ares1999 | 2:c7f2e7d8b305 | 54 | positionControl_Mul_ensemble(AR_BASE, 1000, PLAYTIME, BLED_ON, AR_MILIEU, 160, BLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 55 | positionControl(AR_HAUT, 510, PLAYTIME, BLED_ON, serial_select); |
| ares1999 | 2:c7f2e7d8b305 | 56 | wait_ms(3000); |
| ares1999 | 2:c7f2e7d8b305 | 57 | } |
| ares1999 | 2:c7f2e7d8b305 | 58 | |
| ares1999 | 2:c7f2e7d8b305 | 59 | void fct_bras(void) |
| ares1999 | 2:c7f2e7d8b305 | 60 | { |
| ares1999 | 2:c7f2e7d8b305 | 61 | //Rangement bras bas |
| ares1999 | 2:c7f2e7d8b305 | 62 | positionControl_Mul_ensemble(AV_BASE, 1000, PLAYTIME, RLED_ON, AV_MILIEU, 160, RLED_ON, SERIAL_BAS_GAUCHE); |
| ares1999 | 2:c7f2e7d8b305 | 63 | positionControl(AV_HAUT, 750, PLAYTIME, RLED_ON, SERIAL_BAS_GAUCHE); |
| ares1999 | 2:c7f2e7d8b305 | 64 | wait_ms(TEMPO); |
| ares1999 | 2:c7f2e7d8b305 | 65 | //Rangement bras haut |
| ares1999 | 2:c7f2e7d8b305 | 66 | positionControl_Mul_ensemble(AV_BASE, 955, PLAYTIME, RLED_ON, AV_MILIEU, 35, RLED_ON, SERIAL_HAUT); |
| ares1999 | 2:c7f2e7d8b305 | 67 | positionControl(AV_HAUT, 230, PLAYTIME, RLED_ON, SERIAL_HAUT); |
| ares1999 | 2:c7f2e7d8b305 | 68 | wait_ms(TEMPO_LONGUE); |
| ares1999 | 2:c7f2e7d8b305 | 69 | |
| ares1999 | 2:c7f2e7d8b305 | 70 | //Prise bras bas |
| ares1999 | 2:c7f2e7d8b305 | 71 | positionControl(AV_HAUT, 685, PLAYTIME, GLED_ON, SERIAL_BAS_GAUCHE); |
| ares1999 | 2:c7f2e7d8b305 | 72 | positionControl_Mul_ensemble(AV_BASE, 445, PLAYTIME, GLED_ON, AV_MILIEU, 600, GLED_ON, SERIAL_BAS_GAUCHE); |
| ares1999 | 2:c7f2e7d8b305 | 73 | wait_ms(TEMPO_LONGUE); |
| ares1999 | 2:c7f2e7d8b305 | 74 | //Passe bras bas |
| ares1999 | 2:c7f2e7d8b305 | 75 | positionControl_Mul_ensemble(AV_BASE, 470, 40, BLED_ON, AV_MILIEU, 800, BLED_ON, SERIAL_BAS_GAUCHE); |
| ares1999 | 2:c7f2e7d8b305 | 76 | wait_ms(TEMPO+250); |
| ares1999 | 2:c7f2e7d8b305 | 77 | positionControl(AV_HAUT, 250, 40, BLED_ON, SERIAL_BAS_GAUCHE); |
| ares1999 | 2:c7f2e7d8b305 | 78 | wait_ms(TEMPO_LONGUE); |
| ares1999 | 2:c7f2e7d8b305 | 79 | |
| ares1999 | 2:c7f2e7d8b305 | 80 | //Prise bras haut |
| ares1999 | 2:c7f2e7d8b305 | 81 | positionControl(AV_HAUT, 630, PLAYTIME, GLED_ON, SERIAL_HAUT); |
| ares1999 | 2:c7f2e7d8b305 | 82 | wait_ms(500); |
| ares1999 | 2:c7f2e7d8b305 | 83 | positionControl_Mul_ensemble(AV_BASE, 800, PLAYTIME, GLED_ON, AV_MILIEU, 110, GLED_ON, SERIAL_HAUT); |
| ares1999 | 2:c7f2e7d8b305 | 84 | wait_ms(TEMPO_LONGUE); |
| ares1999 | 2:c7f2e7d8b305 | 85 | //Pré rangement bras haut |
| ares1999 | 2:c7f2e7d8b305 | 86 | positionControl_Mul_ensemble(AV_BASE, 920, PLAYTIME, RLED_ON, AV_MILIEU, 70, RLED_ON, SERIAL_HAUT); |
| ares1999 | 2:c7f2e7d8b305 | 87 | positionControl(AV_HAUT, 650, PLAYTIME, RLED_ON, SERIAL_HAUT); |
| ares1999 | 2:c7f2e7d8b305 | 88 | |
| ares1999 | 2:c7f2e7d8b305 | 89 | //Pré rangement bras bas |
| ares1999 | 2:c7f2e7d8b305 | 90 | positionControl_Mul_ensemble(AV_BASE, 520, PLAYTIME, RLED_ON, AV_MILIEU, 160, RLED_ON, SERIAL_BAS_GAUCHE); |
| ares1999 | 2:c7f2e7d8b305 | 91 | positionControl(AV_HAUT, 750, PLAYTIME, RLED_ON, SERIAL_BAS_GAUCHE); |
| ares1999 | 2:c7f2e7d8b305 | 92 | wait_ms(TEMPO_LONGUE); |
| ares1999 | 2:c7f2e7d8b305 | 93 | //Rangement bras bas |
| ares1999 | 2:c7f2e7d8b305 | 94 | positionControl_Mul_ensemble(AV_HAUT, 750, PLAYTIME, RLED_ON, AV_MILIEU, 160, RLED_ON, SERIAL_BAS_GAUCHE); |
| ares1999 | 2:c7f2e7d8b305 | 95 | positionControl(AV_BASE, 1000, PLAYTIME, RLED_ON, SERIAL_BAS_GAUCHE); |
| ares1999 | 2:c7f2e7d8b305 | 96 | wait_ms(TEMPO); |
| ares1999 | 2:c7f2e7d8b305 | 97 | } |