Revision 149 trunk/tp_info6/Emb_App/programme_principal_etud.c

View differences:

programme_principal_etud.c
127 127
		unsigned char val;
128 128
	} data;
129 129
	VP_INT msg;
130
} CanFrame;*/
130
} CanFrame;*/
131

  
132
short alpha;
133

  
131 134
void rot_tourelle()
132 135
{
133 136
	CanFrame comm;
134 137
	
135 138
	comm.data.id = 'T';
136 139
	comm.data.rtr = 0;		//Indique une ecriture
140
	comm.data.val = 160;
141
	snd_dtq(CanTx, comm.msg);
142
	
143
	dly_tsk(100);
137 144
	comm.data.val = 120;
138 145
	snd_dtq(CanTx, comm.msg);
139
	}
146
	}
147

  
148
void pos_tourelle()
149
{
150
	CanFrame requete, reponse;
151
	
152
	requete.data.id = 'R';
153
	requete.data.rtr = 1;	//Indique une requete de lecture
154
	snd_dtq(CanTx, requete.msg);
155
	
156
	rcv_dtq(CanRx, &reponse.msg);
157
	alpha = reponse.data.val;
158
	} 
159

  
140 160
void main()
141 161
{
142 162
	ports_mcu();
......
157 177
		dly_tsk(100);
158 178
		LED_J=0;
159 179
		dly_tsk(100);
160
    }
161
	rot_tourelle();
180
   		rot_tourelle();
181
	    pos_tourelle();
182
		 }
183
   	
162 184
}
163 185

  
164 186
void acqui()

Also available in: Unified diff