Revision 166

View differences:

trunk/tp_info6/Emb_App/programme_principal_etud.c
130 130
} CanFrame;*/
131 131

  
132 132
short alpha;
133
short erreur;
134
short cmd;
135
void rot_tourelle()
133
short cmd;
134
//short D;
135

  
136
void rot_tourelle()		//commande de la tourelle
136 137
{
137 138
	CanFrame comm;
138 139
	
......
146 147
	snd_dtq(CanTx, comm.msg);*/
147 148
	}
148 149

  
149
void pos_tourelle()
150
void pos_tourelle()  	//Angle de la tourelle
150 151
{
151 152
	CanFrame requete, reponse;
152 153
	
......
157 158
	rcv_dtq(CanRx, &reponse.msg);
158 159
	alpha = reponse.data.val;
159 160
	} 
161

  
162
/*void distance()  	//Angle de la tourelle
163
{
164
	CanFrame requete, reponse;
160 165
	
161
void Asserv0()
166
	requete.data.id = 'R';
167
	requete.data.rtr = 1;	//Indique une requete de lecture
168
	snd_dtq(CanTx, requete.msg);
169
	
170
	rcv_dtq(CanRx, &reponse.msg);
171
	D = reponse.data.val;
172
	} 
173
*/
174
void vitesse()			//commande vitesse des roues
175
{
176
	CanFrame comm;
177
	
178
	comm.data.id = 'V';
179
	comm.data.rtr = 0;		//Indique une ecriture
180
	comm.data.val = 50;
181
	snd_dtq(CanTx, comm.msg);
182
	} 
183
	
184
void Asserv0()		//asservissemt de la tourelle
162 185
{	
163 186
	short consigne=450;
164
	
165

  
187
	short erreur;
166 188
	short k=1;
167 189
	
168 190
	erreur = consigne - alpha;
169 191
	cmd = erreur*k;
170
	//snd_dtq(CanTx, cmd.msg);
171 192
	}
172 193

  
173 194
void main()
......
193 214
	    pos_tourelle();
194 215
		Asserv0();
195 216
		rot_tourelle();
217
		vitesse();
196 218
		 }
197 219
   	
198 220
}

Also available in: Unified diff