dernier TP robot laby m3pi

Dependencies:   mbed FileSystem_POPS m3pi

Committer:
bouaziz
Date:
Mon Feb 04 17:07:54 2019 +0000
Revision:
7:a7bf354ae965
Parent:
6:f7c38d092b97
Child:
8:6e2b5737c86c
polytech labyrinthe M3PI

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bouaziz 0:398afdd73d9e 1
bouaziz 0:398afdd73d9e 2 #include "mbed.h"
bouaziz 0:398afdd73d9e 3 #include "m3pi.h"
bouaziz 0:398afdd73d9e 4 #include "MSCFileSystem.h"
bouaziz 0:398afdd73d9e 5
bouaziz 0:398afdd73d9e 6 m3pi m3pi; // Initialise the m3pi
bouaziz 0:398afdd73d9e 7
bouaziz 0:398afdd73d9e 8 Serial pc(USBTX, USBRX); // For debugging and pc messages, uses commented out to prevent hanging
bouaziz 4:dcad3508bdfb 9 //MSCFileSystem fs("fs");
bouaziz 6:f7c38d092b97 10
bouaziz 7:a7bf354ae965 11 LocalFileSystem local("local");
bouaziz 7:a7bf354ae965 12
bouaziz 6:f7c38d092b97 13 Ticker tic1;
bouaziz 4:dcad3508bdfb 14 Timer tm1;
bouaziz 0:398afdd73d9e 15
bouaziz 0:398afdd73d9e 16 BusOut myleds(LED1, LED2, LED3, LED4);
bouaziz 0:398afdd73d9e 17
bouaziz 4:dcad3508bdfb 18 // all variables are float
bouaziz 4:dcad3508bdfb 19 #define D_TERM 0.0
bouaziz 4:dcad3508bdfb 20 #define I_TERMO 0.1
bouaziz 4:dcad3508bdfb 21 #define I_TERM 0.1
bouaziz 4:dcad3508bdfb 22 #define P_TERM 0.9
bouaziz 4:dcad3508bdfb 23 #define MAX 0.3
bouaziz 4:dcad3508bdfb 24 #define MIN -0.2
bouaziz 4:dcad3508bdfb 25 float current_pos_of_line,derivative,proportional,power,integral,right,left,previous_pos_of_line;
bouaziz 4:dcad3508bdfb 26 float speed =0.3;
bouaziz 4:dcad3508bdfb 27
bouaziz 4:dcad3508bdfb 28
bouaziz 4:dcad3508bdfb 29 unsigned short tabsensor[5];
bouaziz 7:a7bf354ae965 30 #define seuil(x) (x>350 ? 1 : 0)
bouaziz 4:dcad3508bdfb 31 unsigned char statcapt;
bouaziz 7:a7bf354ae965 32 unsigned char LFRstat, LFRvect;
bouaziz 5:0f4a460521be 33
bouaziz 5:0f4a460521be 34 // fonction permet de lire les capteurs sol et de convertir cela sous la forme d'un octet
bouaziz 5:0f4a460521be 35 // seuls 5 bits sont utiles
bouaziz 5:0f4a460521be 36 // Vérifier l'ordre des bits sur la variable retrounée stat
bouaziz 5:0f4a460521be 37 // bit4 à bit0 de stat sachant que bit2 c'est le capteur milieu
bouaziz 5:0f4a460521be 38 unsigned char lecture_captsol(unsigned short *tab){
bouaziz 5:0f4a460521be 39 unsigned char stat=0;
bouaziz 5:0f4a460521be 40 m3pi.calibrated_sensors(tab);
bouaziz 5:0f4a460521be 41 for(unsigned short ii=0;ii<5;ii++){
bouaziz 5:0f4a460521be 42 stat = (stat <<1) | seuil(tab[ii]);
bouaziz 4:dcad3508bdfb 43 }
bouaziz 7:a7bf354ae965 44 LFRstat = (((stat&0x04)==0x04)||((stat&0x03)==0x02)||((stat&0x18)==0x08) ? 0x02 : 0) | (((stat&0x03)==0x03) ? 0x01 : 0)|(((stat&0x18)==0x18) ? 0x04 : 0);
bouaziz 5:0f4a460521be 45 return stat;
bouaziz 5:0f4a460521be 46 }
bouaziz 5:0f4a460521be 47
bouaziz 5:0f4a460521be 48 // Asservissement PID en flottant du robot.
bouaziz 5:0f4a460521be 49 // remplacer certains commentaires de limiteurs llimit checks on motor control
bouaziz 5:0f4a460521be 50 void PIDf(){
bouaziz 5:0f4a460521be 51
bouaziz 5:0f4a460521be 52 // Get the position of the line.
bouaziz 5:0f4a460521be 53 current_pos_of_line = m3pi.line_position();
bouaziz 5:0f4a460521be 54 proportional = current_pos_of_line;
bouaziz 5:0f4a460521be 55 // Compute the derivative
bouaziz 5:0f4a460521be 56 derivative = current_pos_of_line - previous_pos_of_line;
bouaziz 5:0f4a460521be 57 // Compute the integral
bouaziz 5:0f4a460521be 58 integral = (integral+ I_TERMO*proportional)/(1+I_TERMO);
bouaziz 5:0f4a460521be 59 // Remember the last position.
bouaziz 5:0f4a460521be 60 previous_pos_of_line = current_pos_of_line;
bouaziz 5:0f4a460521be 61 // Compute the power
bouaziz 5:0f4a460521be 62 power = (proportional * (P_TERM) ) + (integral*(I_TERM)) + (derivative*(D_TERM)) ;
bouaziz 5:0f4a460521be 63 // Compute new speeds
bouaziz 5:0f4a460521be 64 right = speed-(power*MAX);
bouaziz 5:0f4a460521be 65 left = speed+(power*MAX);
bouaziz 5:0f4a460521be 66 // limit checks on motor control
bouaziz 5:0f4a460521be 67 //MIN <right < MAX
bouaziz 5:0f4a460521be 68 // MIN <left < MAX
bouaziz 7:a7bf354ae965 69 left = (left>MAX ? MAX :(left<MIN ? MIN : left));
bouaziz 5:0f4a460521be 70 right = (right>MAX ? MAX :(right<MIN ? MIN : right));
bouaziz 5:0f4a460521be 71 // send command to motors
bouaziz 5:0f4a460521be 72 m3pi.left_motor(left);
bouaziz 5:0f4a460521be 73 m3pi.right_motor(right);
bouaziz 4:dcad3508bdfb 74 }
bouaziz 4:dcad3508bdfb 75
bouaziz 4:dcad3508bdfb 76 volatile char flag10ms;
bouaziz 4:dcad3508bdfb 77 void inter1(){
bouaziz 4:dcad3508bdfb 78 flag10ms=1;
bouaziz 4:dcad3508bdfb 79 }
bouaziz 4:dcad3508bdfb 80
bouaziz 5:0f4a460521be 81 int v,count;
bouaziz 4:dcad3508bdfb 82 unsigned char delai600ms;
bouaziz 4:dcad3508bdfb 83 char chain[10];
bouaziz 6:f7c38d092b97 84 volatile char flag1sec,flagmesure;
bouaziz 6:f7c38d092b97 85 char autom;
bouaziz 6:f7c38d092b97 86 unsigned int valtimer;
bouaziz 6:f7c38d092b97 87
bouaziz 6:f7c38d092b97 88 void automate(){
bouaziz 6:f7c38d092b97 89
bouaziz 6:f7c38d092b97 90 switch(autom){
bouaziz 6:f7c38d092b97 91 case 0 : m3pi.forward(0.3);
bouaziz 6:f7c38d092b97 92 autom=1;
bouaziz 6:f7c38d092b97 93 break;
bouaziz 6:f7c38d092b97 94 case 1 :
bouaziz 6:f7c38d092b97 95 if((statcapt&0x11)==0x11){
bouaziz 6:f7c38d092b97 96 autom=2;
bouaziz 6:f7c38d092b97 97 }
bouaziz 6:f7c38d092b97 98 break;
bouaziz 6:f7c38d092b97 99 case 2 :
bouaziz 6:f7c38d092b97 100 if((statcapt&0x11)==0x00){
bouaziz 6:f7c38d092b97 101 autom=3;
bouaziz 6:f7c38d092b97 102 tm1.start();
bouaziz 6:f7c38d092b97 103 }
bouaziz 6:f7c38d092b97 104 break;
bouaziz 6:f7c38d092b97 105 case 3 :
bouaziz 6:f7c38d092b97 106 if((statcapt&0x11)==0x11){
bouaziz 6:f7c38d092b97 107 autom=4;
bouaziz 6:f7c38d092b97 108 m3pi.stop();
bouaziz 6:f7c38d092b97 109 tm1.stop();
bouaziz 6:f7c38d092b97 110 valtimer=tm1.read_us();
bouaziz 6:f7c38d092b97 111 flagmesure=1;
bouaziz 6:f7c38d092b97 112 }
bouaziz 6:f7c38d092b97 113 break;
bouaziz 6:f7c38d092b97 114 default:
bouaziz 6:f7c38d092b97 115 break;
bouaziz 6:f7c38d092b97 116 }
bouaziz 6:f7c38d092b97 117 }
bouaziz 5:0f4a460521be 118
bouaziz 6:f7c38d092b97 119 char sensrotation=0; // 0 1 Left 2 Right
bouaziz 6:f7c38d092b97 120 char rotation_flag=0;
bouaziz 7:a7bf354ae965 121 static unsigned char automr=0;
bouaziz 6:f7c38d092b97 122 void automrotation(){
bouaziz 7:a7bf354ae965 123
bouaziz 6:f7c38d092b97 124 static unsigned short vtime;
bouaziz 6:f7c38d092b97 125 switch(automr){
bouaziz 6:f7c38d092b97 126 case 0 : m3pi.stop();
bouaziz 6:f7c38d092b97 127 automr=1;
bouaziz 6:f7c38d092b97 128 vtime=0;
bouaziz 6:f7c38d092b97 129 break;
bouaziz 6:f7c38d092b97 130 case 1 :vtime++;
bouaziz 6:f7c38d092b97 131 if(vtime>=25){
bouaziz 6:f7c38d092b97 132 switch(sensrotation){
bouaziz 6:f7c38d092b97 133 case 2 :
bouaziz 6:f7c38d092b97 134 m3pi.right(0.3);
bouaziz 6:f7c38d092b97 135 break;
bouaziz 6:f7c38d092b97 136 case 1 :
bouaziz 6:f7c38d092b97 137 m3pi.left(0.3);
bouaziz 6:f7c38d092b97 138 break;
bouaziz 6:f7c38d092b97 139 default :
bouaziz 6:f7c38d092b97 140 automr=0;
bouaziz 6:f7c38d092b97 141 break;
bouaziz 6:f7c38d092b97 142 }
bouaziz 6:f7c38d092b97 143 automr=2;
bouaziz 6:f7c38d092b97 144 }
bouaziz 6:f7c38d092b97 145 break;
bouaziz 6:f7c38d092b97 146 case 2 :
bouaziz 6:f7c38d092b97 147 if(sensrotation){
bouaziz 6:f7c38d092b97 148 if((statcapt&1)&& (sensrotation==2)){
bouaziz 6:f7c38d092b97 149 automr=3;
bouaziz 6:f7c38d092b97 150 }
bouaziz 7:a7bf354ae965 151 }else{
bouaziz 6:f7c38d092b97 152 if((statcapt&0x10) && (sensrotation==1)){
bouaziz 6:f7c38d092b97 153 automr=3;
bouaziz 6:f7c38d092b97 154 }
bouaziz 6:f7c38d092b97 155 }
bouaziz 6:f7c38d092b97 156 break;
bouaziz 6:f7c38d092b97 157 case 3 :
bouaziz 6:f7c38d092b97 158 if( ((sensrotation==2)&&(statcapt&0x06))||((sensrotation==1)&&(statcapt&0x0C)) ) {
bouaziz 6:f7c38d092b97 159 m3pi.stop();
bouaziz 6:f7c38d092b97 160 vtime=0;
bouaziz 6:f7c38d092b97 161 automr=4;
bouaziz 6:f7c38d092b97 162 }
bouaziz 6:f7c38d092b97 163 break;
bouaziz 6:f7c38d092b97 164 case 4 :vtime++;
bouaziz 6:f7c38d092b97 165 if(vtime>=30){
bouaziz 6:f7c38d092b97 166 rotation_flag=1;
bouaziz 6:f7c38d092b97 167 automr=0;
bouaziz 6:f7c38d092b97 168 }
bouaziz 6:f7c38d092b97 169 break;
bouaziz 6:f7c38d092b97 170 default:
bouaziz 6:f7c38d092b97 171 automr=0;
bouaziz 6:f7c38d092b97 172 break;
bouaziz 6:f7c38d092b97 173 }
bouaziz 6:f7c38d092b97 174 }
bouaziz 6:f7c38d092b97 175
bouaziz 6:f7c38d092b97 176 unsigned char inver;
bouaziz 6:f7c38d092b97 177 char trotate[2] = {1,2};
bouaziz 6:f7c38d092b97 178 char indexrotate=0;
bouaziz 7:a7bf354ae965 179
bouaziz 7:a7bf354ae965 180 #define MAXSAVE 4000
bouaziz 7:a7bf354ae965 181 unsigned char sauvetab[MAXSAVE][3];
bouaziz 7:a7bf354ae965 182
bouaziz 7:a7bf354ae965 183 unsigned char texttab[500];
bouaziz 7:a7bf354ae965 184 unsigned short intercount;
bouaziz 7:a7bf354ae965 185
bouaziz 7:a7bf354ae965 186 unsigned lvwait,lwait2;
bouaziz 0:398afdd73d9e 187 int main() {
bouaziz 7:a7bf354ae965 188 unsigned short i=0,ii;
bouaziz 6:f7c38d092b97 189 static char automain=0;
bouaziz 7:a7bf354ae965 190 myleds=0x0;
bouaziz 7:a7bf354ae965 191 FILE *p= fopen("/local/tt.txt","w");
bouaziz 7:a7bf354ae965 192 if(p!=0) {
bouaziz 7:a7bf354ae965 193 myleds=1;
bouaziz 7:a7bf354ae965 194 }
bouaziz 6:f7c38d092b97 195 wait(1.);
bouaziz 0:398afdd73d9e 196 m3pi.sensor_auto_calibrate();
bouaziz 0:398afdd73d9e 197 wait(1.);
bouaziz 6:f7c38d092b97 198 //3pi.cls();
bouaziz 7:a7bf354ae965 199
bouaziz 5:0f4a460521be 200 tic1.attach(&inter1,0.01);
bouaziz 6:f7c38d092b97 201 tm1.reset();
bouaziz 4:dcad3508bdfb 202 // fprintf(p,"ecrire dans la cle USB\r\n");
bouaziz 4:dcad3508bdfb 203 // fclose(p);
bouaziz 0:398afdd73d9e 204
bouaziz 0:398afdd73d9e 205 while(1) {
bouaziz 5:0f4a460521be 206 // exemple de code
bouaziz 5:0f4a460521be 207 if(flag10ms){
bouaziz 6:f7c38d092b97 208 // myleds=0;
bouaziz 4:dcad3508bdfb 209 flag10ms=0;
bouaziz 5:0f4a460521be 210 statcapt=lecture_captsol(tabsensor);
bouaziz 7:a7bf354ae965 211 LFRvect = (LFRvect <<4) + LFRstat;
bouaziz 7:a7bf354ae965 212 if(i<MAXSAVE){
bouaziz 7:a7bf354ae965 213 sauvetab[i][0]=automain;
bouaziz 7:a7bf354ae965 214 sauvetab[i][1]=LFRvect;
bouaziz 7:a7bf354ae965 215 sauvetab[i][2]=statcapt;
bouaziz 7:a7bf354ae965 216 i++;
bouaziz 7:a7bf354ae965 217 }
bouaziz 6:f7c38d092b97 218 switch(automain){
bouaziz 7:a7bf354ae965 219 case 0 : PIDf();
bouaziz 7:a7bf354ae965 220 switch(LFRvect) {
bouaziz 7:a7bf354ae965 221 case 0x77 :
bouaziz 7:a7bf354ae965 222 automain=37;
bouaziz 7:a7bf354ae965 223 lvwait=0;
bouaziz 7:a7bf354ae965 224 break;
bouaziz 7:a7bf354ae965 225 case 0x00 :
bouaziz 7:a7bf354ae965 226 //m3pi.stop();
bouaziz 7:a7bf354ae965 227 automain= 3;
bouaziz 7:a7bf354ae965 228 lvwait=0;
bouaziz 7:a7bf354ae965 229 texttab[intercount++]='B';
bouaziz 7:a7bf354ae965 230 break;
bouaziz 7:a7bf354ae965 231 case 0x33 :
bouaziz 7:a7bf354ae965 232 automain= 13;
bouaziz 7:a7bf354ae965 233 texttab[intercount++]='R';
bouaziz 7:a7bf354ae965 234 break;
bouaziz 7:a7bf354ae965 235 case 0x66 :
bouaziz 7:a7bf354ae965 236 automain= 26;
bouaziz 7:a7bf354ae965 237
bouaziz 7:a7bf354ae965 238 break;
bouaziz 7:a7bf354ae965 239 case 0x22 :
bouaziz 7:a7bf354ae965 240
bouaziz 7:a7bf354ae965 241 // break;
bouaziz 7:a7bf354ae965 242 default :
bouaziz 7:a7bf354ae965 243 break;
bouaziz 7:a7bf354ae965 244 }
bouaziz 7:a7bf354ae965 245 break;
bouaziz 7:a7bf354ae965 246 case 3 : lvwait++;
bouaziz 7:a7bf354ae965 247 if(lvwait>(60/10)){
bouaziz 7:a7bf354ae965 248 m3pi.stop();
bouaziz 7:a7bf354ae965 249 automain=1;
bouaziz 7:a7bf354ae965 250 }
bouaziz 7:a7bf354ae965 251 break;
bouaziz 7:a7bf354ae965 252 case 1 : //lancer STOP avec rotation à droite
bouaziz 7:a7bf354ae965 253 lvwait++;
bouaziz 7:a7bf354ae965 254 if(lvwait>(500/10)){
bouaziz 7:a7bf354ae965 255 m3pi.right(0.2);
bouaziz 7:a7bf354ae965 256 automain=2;
bouaziz 7:a7bf354ae965 257 }
bouaziz 7:a7bf354ae965 258 break;
bouaziz 7:a7bf354ae965 259 case 2 : // jattends pour STOPPER
bouaziz 7:a7bf354ae965 260 if(LFRvect==0x22){
bouaziz 7:a7bf354ae965 261 m3pi.stop();
bouaziz 7:a7bf354ae965 262 automain=0;
bouaziz 7:a7bf354ae965 263 }
bouaziz 7:a7bf354ae965 264 break;
bouaziz 7:a7bf354ae965 265 case 13 : //inter droite ou tout droit
bouaziz 7:a7bf354ae965 266 PIDf();
bouaziz 7:a7bf354ae965 267 switch(LFRvect){
bouaziz 7:a7bf354ae965 268 case 0x00 :
bouaziz 7:a7bf354ae965 269 m3pi.stop();
bouaziz 7:a7bf354ae965 270 lvwait=0;
bouaziz 7:a7bf354ae965 271 automain =1;
bouaziz 7:a7bf354ae965 272 case 0x22 :
bouaziz 7:a7bf354ae965 273 //m3pi.stop();
bouaziz 7:a7bf354ae965 274 lvwait=0;
bouaziz 7:a7bf354ae965 275 automain =14;
bouaziz 7:a7bf354ae965 276 default :
bouaziz 7:a7bf354ae965 277 break;
bouaziz 7:a7bf354ae965 278 }
bouaziz 7:a7bf354ae965 279 break;
bouaziz 7:a7bf354ae965 280
bouaziz 7:a7bf354ae965 281 case 14 :
bouaziz 7:a7bf354ae965 282 lvwait++;
bouaziz 7:a7bf354ae965 283 if(lvwait>(60/10)){
bouaziz 7:a7bf354ae965 284 m3pi.stop();
bouaziz 7:a7bf354ae965 285 automain=15;
bouaziz 7:a7bf354ae965 286 lvwait=0;
bouaziz 7:a7bf354ae965 287 }
bouaziz 7:a7bf354ae965 288 break;
bouaziz 7:a7bf354ae965 289
bouaziz 7:a7bf354ae965 290 case 15 :
bouaziz 7:a7bf354ae965 291 lvwait++;
bouaziz 7:a7bf354ae965 292 if(lvwait>(500/10)){
bouaziz 7:a7bf354ae965 293 m3pi.right(0.2);
bouaziz 7:a7bf354ae965 294 automain=16;
bouaziz 7:a7bf354ae965 295 lvwait=0;
bouaziz 7:a7bf354ae965 296 }
bouaziz 7:a7bf354ae965 297 break;
bouaziz 7:a7bf354ae965 298 case 16 :
bouaziz 7:a7bf354ae965 299 if((LFRvect&0x22)==0){
bouaziz 7:a7bf354ae965 300 automain=2;
bouaziz 7:a7bf354ae965 301 }
bouaziz 7:a7bf354ae965 302 break;
bouaziz 7:a7bf354ae965 303 case 26 : // inter gauche ou tout droit
bouaziz 7:a7bf354ae965 304 PIDf();
bouaziz 7:a7bf354ae965 305 switch(LFRvect){
bouaziz 7:a7bf354ae965 306 case 0x00 :
bouaziz 7:a7bf354ae965 307 // m3pi.stop();
bouaziz 7:a7bf354ae965 308 lvwait=0;
bouaziz 7:a7bf354ae965 309 automain =27;
bouaziz 7:a7bf354ae965 310 texttab[intercount++]='L';
bouaziz 7:a7bf354ae965 311 break;
bouaziz 7:a7bf354ae965 312 case 0x22 : texttab[intercount++]='F';
bouaziz 7:a7bf354ae965 313 automain =0;
bouaziz 7:a7bf354ae965 314 break;
bouaziz 7:a7bf354ae965 315 default :
bouaziz 7:a7bf354ae965 316 break;
bouaziz 7:a7bf354ae965 317 }
bouaziz 7:a7bf354ae965 318 break;
bouaziz 7:a7bf354ae965 319 case 27 :
bouaziz 7:a7bf354ae965 320 lvwait++;
bouaziz 7:a7bf354ae965 321 if(lvwait>(50/10)){
bouaziz 7:a7bf354ae965 322 m3pi.stop();
bouaziz 7:a7bf354ae965 323 automain=28;
bouaziz 7:a7bf354ae965 324 lvwait=0;
bouaziz 7:a7bf354ae965 325 }
bouaziz 7:a7bf354ae965 326 break;
bouaziz 7:a7bf354ae965 327 case 28 :
bouaziz 7:a7bf354ae965 328 lvwait++;
bouaziz 7:a7bf354ae965 329 if(lvwait>(500/10)){
bouaziz 7:a7bf354ae965 330 m3pi.left(0.2);
bouaziz 7:a7bf354ae965 331 automain=2;
bouaziz 7:a7bf354ae965 332 }
bouaziz 7:a7bf354ae965 333 break;
bouaziz 7:a7bf354ae965 334 case 29 :
bouaziz 7:a7bf354ae965 335 if(lvwait++>2){
bouaziz 6:f7c38d092b97 336 m3pi.stop();
bouaziz 7:a7bf354ae965 337 automain=0;
bouaziz 7:a7bf354ae965 338 }
bouaziz 6:f7c38d092b97 339 break;
bouaziz 7:a7bf354ae965 340 case 37 :
bouaziz 7:a7bf354ae965 341 PIDf();
bouaziz 7:a7bf354ae965 342 lvwait++;
bouaziz 7:a7bf354ae965 343 if(LFRvect==0x77){
bouaziz 7:a7bf354ae965 344 if((lvwait>15)){
bouaziz 7:a7bf354ae965 345 m3pi.stop();
bouaziz 7:a7bf354ae965 346 automain=38;
bouaziz 7:a7bf354ae965 347 }
bouaziz 7:a7bf354ae965 348 }else{
bouaziz 7:a7bf354ae965 349 texttab[intercount++]='R';
bouaziz 7:a7bf354ae965 350 automain= 13;
bouaziz 7:a7bf354ae965 351 lvwait=0;
bouaziz 6:f7c38d092b97 352 }
bouaziz 7:a7bf354ae965 353 break;
bouaziz 7:a7bf354ae965 354 case 38 :
bouaziz 7:a7bf354ae965 355 myleds=0x09;
bouaziz 6:f7c38d092b97 356 default :
bouaziz 6:f7c38d092b97 357 break;
bouaziz 5:0f4a460521be 358 }
bouaziz 6:f7c38d092b97 359
bouaziz 7:a7bf354ae965 360 /* if(i<MAXSAVE){
bouaziz 7:a7bf354ae965 361 sauvetab[i][0]=automain;
bouaziz 7:a7bf354ae965 362 sauvetab[i][1]=statcapt;
bouaziz 7:a7bf354ae965 363 sauvetab[i][2]=LFRvect;
bouaziz 7:a7bf354ae965 364 sauvetab[i][3]=automr;
bouaziz 7:a7bf354ae965 365 i=i+1;
bouaziz 7:a7bf354ae965 366 }
bouaziz 7:a7bf354ae965 367 */
bouaziz 5:0f4a460521be 368 }
bouaziz 7:a7bf354ae965 369 if(i>=MAXSAVE) {
bouaziz 7:a7bf354ae965 370 m3pi.stop();
bouaziz 7:a7bf354ae965 371 texttab[intercount++]=0;
bouaziz 7:a7bf354ae965 372 fprintf(p,"%s\n",texttab);
bouaziz 7:a7bf354ae965 373 for(i=0;i<MAXSAVE;i++){
bouaziz 7:a7bf354ae965 374 fprintf(p,"%3u %02x %02x\n",(unsigned)sauvetab[i][0],(unsigned)sauvetab[i][1],(unsigned)sauvetab[i][2]);
bouaziz 7:a7bf354ae965 375 }
bouaziz 7:a7bf354ae965 376 myleds=0x0f;
bouaziz 7:a7bf354ae965 377 fclose(p);
bouaziz 7:a7bf354ae965 378 while(1);
bouaziz 7:a7bf354ae965 379 }
bouaziz 7:a7bf354ae965 380
bouaziz 7:a7bf354ae965 381
bouaziz 0:398afdd73d9e 382 }
bouaziz 4:dcad3508bdfb 383
bouaziz 0:398afdd73d9e 384 }