summaryrefslogtreecommitdiff
path: root/n/es
diff options
context:
space:
mode:
authordalmais2005-05-01 18:57:43 +0000
committerdalmais2005-05-01 18:57:43 +0000
commitaf22488810653fdbc36f23a0cc622d371918a3ad (patch)
treebe8f1a911a2d2c6aee47e3e515cc05a8b12bd489 /n/es
parent990bc98cb0c2a1b511f2fc1865cfb2975d686b60 (diff)
changement de la manière dont est renvoyé les valeurs de la tourelle.
Diffstat (limited to 'n/es')
-rw-r--r--n/es/src/main.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/n/es/src/main.c b/n/es/src/main.c
index 973e320..bc8cb41 100644
--- a/n/es/src/main.c
+++ b/n/es/src/main.c
@@ -84,13 +84,15 @@ int main (void)
uint8_t temp_sens = 1;
uint8_t compteur = 0;
uint16_t tableau_sharp[3];
-
+ uint8_t renvoie_tourelle;
+
/// intialisation
DDRD = 0xC0;
DDRA = 0x00;
DDRB = 0x13;
DDRC = 0x00;
+
rs232_init ();
proto_send0('z');
pont_init();
@@ -128,17 +130,40 @@ int main (void)
if(temp_sens != sens)
{
temp_sens = sens; // permet de savoir quand on a fini un tour
- proto_send1b ('t',nombre_valeur_tourelle);
+
+
if(nombre_valeur_tourelle > 0)
{
- proto_send1b ('u',angle_tourelle[0]);
- proto_send1w ('v',tableau_longueur_tourelle[angle_tourelle[0]]);
+ renvoie_tourelle = angle_tourelle[0];
+ renvoie_tourelle &= 255;
+ proto_send2w ('t',renvoie_tourelle,tableau_longueur_tourelle[angle_tourelle[0]]);
}
+ else proto_send2w ('t',0x0100,0x00);
+
+
if(nombre_valeur_tourelle > 1)
{
- proto_send1b ('w',angle_tourelle[1]);
- proto_send1w ('x',tableau_longueur_tourelle[angle_tourelle[1]]);
+ renvoie_tourelle = angle_tourelle[1];
+ renvoie_tourelle &= 511;
+ proto_send2w ('t',renvoie_tourelle,tableau_longueur_tourelle[angle_tourelle[1]]);
+ }
+ else proto_send2w ('t',0x0200,0x00);
+ if(nombre_valeur_tourelle > 2)
+ {
+ renvoie_tourelle = angle_tourelle[2];
+ renvoie_tourelle &= 765;
+ proto_send2w ('t',renvoie_tourelle,tableau_longueur_tourelle[angle_tourelle[2]]);
+ }
+ else proto_send2w ('t',0x0300,0x00);
+ if(nombre_valeur_tourelle > 3)
+ {
+ renvoie_tourelle = angle_tourelle[3];
+ renvoie_tourelle &= 1023;
+ proto_send2w ('t',renvoie_tourelle,tableau_longueur_tourelle[angle_tourelle[3]]);
}
+ else proto_send2w ('t',0x0400,0x00);
+
+
nombre_valeur_tourelle = 0;
}