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 ident_crac
Revision 18:972d29c668a5, committed 2019-05-25
- Comitter:
- kyxstark
- Date:
- Sat May 25 14:08:48 2019 +0000
- Parent:
- 17:fcfdd7de9039
- Commit message:
- ralentissement courroies du haut;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat May 25 00:56:34 2019 +0000
+++ b/main.cpp Sat May 25 14:08:48 2019 +0000
@@ -31,11 +31,16 @@
#ifdef ROBOT_BIG
PwmOut ascenseur[8] = {PC_9, PA_8, PA_9, PA_10, PC_7, PC_8, PB_10 ,PB_2};
-PwmOut* ascenseur_D;
-PwmOut* ascenseur_G;
+PwmOut* ascenseur_D = ascenseur;
+PwmOut* ascenseur_G = ascenseur+4;
-#define VIT_COURROIE_V 0.6
-#define VIT_COURROIE_L 0.5
+//ascenseur_D = ascenseur;
+//ascenseur_G = ascenseur + 4;
+
+#define VIT_COURROIE_HAUT_V 0.5
+#define VIT_COURROIE_HAUT_L 0.4
+#define VIT_COURROIE_BAS_V 0.6
+#define VIT_COURROIE_BAS_L 0.5
void set_ascensseur(int allume);
#endif
@@ -186,8 +191,6 @@
ascenseur[i].period_us(50);
}
- ascenseur_D = ascenseur;
- ascenseur_G = ascenseur + 4;
set_ascensseur(0);
@@ -228,28 +231,77 @@
}
#ifdef ROBOT_BIG
void set_ascensseur(int allume){
- float vitG, vitD;
-
+ /*PwmOut* vitH, vitL;
switch(allume){
case 1:
- vitG = VIT_COURROIE_V;
- vitD = VIT_COURROIE_L;
+ vitH = ascenseur_G;
+ vitL = ascenseur_D;
break;
case 2:
- vitG = VIT_COURROIE_L;
- vitD = VIT_COURROIE_V;
+ vitH = ascenseur_G;
+ vitL = ascenseur_D;
break;
default:
vitG = 0;
vitD = 0;
break;
}
-
- for (int i=0; i<4; i++)
+ for (int i=0; i<3; i++)
{
- ascenseur_D[i] = vitD;
- ascenseur_G[i] = vitG;
+ vitL[i] = VIT_COURROIE_BAS_L;
+ vitH[i] = VIT_COURROIE_BAS_V;
}
+
+ vitL[3] = VIT_COURROIE_HEUT_L;
+ vitH[3] = VIT_COURROIE_HAUT_V;*/
+
+
+
+ // float vitG, vitD, vitHG, vitHD;
+
+ switch(allume){
+ case 1:
+ /*
+ vitG = VIT_COURROIE_BAS_V;
+ vitD = VIT_COURROIE_BAS_L;
+ vitHG = VIT_COURROIE_HAUT_V;
+ vitHD = VIT_COURROIE_HEUT_L;*/
+ for (int i=0; i<3; i++)
+ {
+ ascenseur_D[i] = VIT_COURROIE_BAS_L;
+ ascenseur_G[i] = VIT_COURROIE_BAS_V;
+ }
+
+ ascenseur_D[3] = VIT_COURROIE_HAUT_L;
+ ascenseur_G[3] = VIT_COURROIE_HAUT_V;
+ break;
+ case 2:
+ /*
+ vitG = VIT_COURROIE_BAS_L;
+ vitD = VIT_COURROIE_BAS_V;
+ vitHG = VIT_COURROIE_HAUT_L;
+ vitHD = VIT_COURROIE_HEUT_V;*/
+ for (int i=0; i<3; i++)
+ {
+ ascenseur_D[i] = VIT_COURROIE_BAS_V;
+ ascenseur_G[i] = VIT_COURROIE_BAS_L;
+ }
+
+ ascenseur_D[3] = VIT_COURROIE_HAUT_V;
+ ascenseur_G[3] = VIT_COURROIE_HAUT_L;
+ break;
+ default:
+ for (int i=0; i<4; i++)
+ {
+ ascenseur_D[i] = 0;
+ ascenseur_G[i] = 0;
+ }
+ break;
+ }
+
+
+
+
}
#endif