Projet

Général

Profil

« Précédent | Suivant » 

Révision 149

Ajouté par stpouotong il y a plus de 6 ans

position de la tourelle ok

Voir les différences:

trunk/tp_info6/Emb_App/programme_principal_etud.c
unsigned char val;
} data;
VP_INT msg;
} CanFrame;*/
} CanFrame;*/
short alpha;
void rot_tourelle()
{
CanFrame comm;
comm.data.id = 'T';
comm.data.rtr = 0; //Indique une ecriture
comm.data.val = 160;
snd_dtq(CanTx, comm.msg);
dly_tsk(100);
comm.data.val = 120;
snd_dtq(CanTx, comm.msg);
}
}
void pos_tourelle()
{
CanFrame requete, reponse;
requete.data.id = 'R';
requete.data.rtr = 1; //Indique une requete de lecture
snd_dtq(CanTx, requete.msg);
rcv_dtq(CanRx, &reponse.msg);
alpha = reponse.data.val;
}
void main()
{
ports_mcu();
......
dly_tsk(100);
LED_J=0;
dly_tsk(100);
}
rot_tourelle();
rot_tourelle();
pos_tourelle();
}
}
void acqui()

Formats disponibles : Unified diff