Révision 152
Ajouté par stpouotong il y a plus de 6 ans
trunk/tp_info6/Emb_App/programme_principal_etud.c | ||
---|---|---|
} CanFrame;*/
|
||
|
||
short alpha;
|
||
|
||
short erreur;
|
||
short cmd;
|
||
void rot_tourelle()
|
||
{
|
||
CanFrame comm;
|
||
|
||
comm.data.id = 'T';
|
||
comm.data.rtr = 0; //Indique une ecriture
|
||
comm.data.val = 160;
|
||
comm.data.val = cmd;
|
||
snd_dtq(CanTx, comm.msg);
|
||
|
||
dly_tsk(100);
|
||
/*dly_tsk(100);
|
||
comm.data.val = 120;
|
||
snd_dtq(CanTx, comm.msg);
|
||
snd_dtq(CanTx, comm.msg);*/
|
||
}
|
||
|
||
void pos_tourelle()
|
||
... | ... | |
rcv_dtq(CanRx, &reponse.msg);
|
||
alpha = reponse.data.val;
|
||
}
|
||
|
||
void Asserv0()
|
||
{
|
||
short consigne=450;
|
||
|
||
|
||
short k=1;
|
||
|
||
erreur = consigne - alpha;
|
||
cmd = erreur*k;
|
||
//snd_dtq(CanTx, cmd.msg);
|
||
}
|
||
|
||
void main()
|
||
{
|
||
... | ... | |
LED_J=1;
|
||
dly_tsk(100);
|
||
LED_J=0;
|
||
dly_tsk(100);
|
||
rot_tourelle();
|
||
dly_tsk(100);
|
||
pos_tourelle();
|
||
Asserv0();
|
||
rot_tourelle();
|
||
}
|
||
|
||
}
|
Formats disponibles : Unified diff
implentation de la fonction Asserv0 ok