You are on page 1of 2

P1=0

BAN=1
FOR P=P1 TO 35
IF VEC1[P]!=0 THEN
IF BAN=1 THEN
CONTAR=0
BAN=0
ELSE
CONTAR=CONTAR+1
ENDIF
IF P>=0 AND P<=5 THEN
VEC2[CONTAR]=1
ENDIF
IF P>=6 AND P<=11 THEN
VEC2[CONTAR]=2
ENDIF
IF P>=12 AND P<=17 THEN
VEC2[CONTAR]=3
ENDIF
IF P>=18 AND P<=23 THEN
VEC2[CONTAR]=4
ENDIF
IF P>=24 AND P<=29 THEN
VEC2[CONTAR]=5
ENDIF
IF P>=30 AND P<=35 THEN
VEC2[CONTAR]=6
ENDIF
IF P>=30 THEN
CAPAS=CAPAS+1
GOTO SALTO
ENDIF

P1=P1+6
CAPAS=CAPAS+1
ENDIF

NEXT P
SALTO:
CONTAR=0

#include <18f4550.h>
#fuses XT,NOWDT
#use delay(clock=20000000)
#use fast_io(b)
void main(){

set_tris_b(0b000);

int vec1[36];
int vec2[6];
int p,p1,contar,ban,contador2,ban2,ban3;
int r,z,x,i,k,l,t,flag,temp,cont,cont2;
int valor,n,valor2,capas,cont3;
long c,w,j,c1,c2,con1,con2,tiempo,ref

output_b(0x00);

k=1;
flag=1;
cont=0;
n=1;
valor=1;
valor2=1;
flag=1;
cont3=0;
cont2=0;
ref=0;
ban3=0;

output_low(pin_b2);

}