#include <16F887.h>
#use delay(clock=20000000)
#fuses NOWDT, hs, PUT, NOPROTECT
#use RS232(BAUD=9600,BITS=8,PARITY=N,XMIT=PIN_C6,RCV=PIN_C7)
//#use standard_io(d)
char valor;
char valor1;
const char TEXT []={"..."};
const char TEXT1 []={"..."};
int i,j,k,d,n,m,s,DATA;
int1 z=0;
//------------------------------------------------------------------
const char FONT1[32][7] ={
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, // Space
0xFB,0xFB,0xFB,0xFB,0xFB,0xFF,0xFB, // !
0xF5,0xF5,0xF5,0xFF,0xFF,0xFF,0xFF, // "
0xF5,0xF5,0xE0,0xF5,0xE0,0xF5,0xF5, // #
0xFB,0xF0,0xEB,0xF1,0xFA,0xE1,0xFB, // $
0xE3,0xEA,0xE5,0xFB,0xF4,0xEA,0xF8, // %
0xF7,0xEB,0xEB,0xF7,0xEA,0xED,0xF2, // &
0xF9,0xF9,0xFD,0xFB,0xFF,0xFF,0xFF, // '
0xFD,0xFB,0xF7,0xF7,0xF7,0xFB,0xFD, // (
0xF7,0xFB,0xFD,0xFD,0xFD,0xFB,0xF7, // )
0xFB,0xEA,0xF1,0xFB,0xF1,0xEA,0xFB, // *
0xFF,0xFB,0xFB,0xE0,0xFB,0xFB,0xFF, // +
0xFF,0xFF,0xFF,0xF3,0xF3,0xFB,0xF7, // ,
0xFF,0xFF,0xFF,0xF1,0xFF,0xFF,0xFF, // -
0xFF,0xFF,0xFF,0xFF,0xFF,0xF3,0xF3, // .
0xFF,0xFE,0xFD,0xFB,0xF7,0xEF,0xFF, // /
0xF1,0xEE,0xEC,0xEA,0xE6,0xEE,0xF1, // 0
0xFB,0xF3,0xFB,0xFB,0xFB,0xFB,0xF1, // 1
0xF1,0xEE,0xFE,0xF1,0xEF,0xEF,0xE0, // 2
0xF1,0xEE,0xFE,0xF9,0xFE,0xEE,0xF1, // 3
0xFD,0xF9,0xF5,0xED,0xE0,0xFD,0xFD, // 4
0xE0,0xEF,0xE1,0x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,0xFD,0xFD,0xFD,0xF3, // j
0xF7,0xF7,0xF6,0xF5,0xF3,0xF5,0xF6, // k
0xF3,0xFB,0xFB,0xFB,0xFB,0xFB,0xF1, // l
0xFF,0xFF,0xE5,0xEA,0xEA,0xEA,0xEA, // m
0xFF,0xFF,0xE9,0xE6,0xEE,0xEE,0xEE, // n
0xFF,0xFF,0xF1,0xEE,0xEE,0xEE,0xF1, // o
0xFF,0xFF,0xE1,0xEE,0xE1,0xEF,0xEF, // p
0xFF,0xFF,0xF0,0xEE,0xF0,0xFE,0xFE, // q
0xFF,0xFF,0xE9,0xE6,0xEF,0xEF,0xEF, // r
0xFF,0xFF,0xF0,0xEF,0xF1,0xFE,0xE1, // s
0xFB,0xFB,0xF0,0xFB,0xFB,0xFB,0xFC, // t
0xFF,0xFF,0xEE,0xEE,0xEE,0xEC,0xF2, // u
0xFF,0xFF,0xEE,0xEE,0xEE,0xF5,0xFB, // v
0xFF,0xFF,0xEE,0xEE,0xEA,0xEA,0xF4, // w
0xFF,0xFF,0xEE,0xF5,0xFB,0xF5,0xEE, // x
0xFF,0xFF,0xEE,0xF5,0xFB,0xFB,0xF3, // y
0xFF,0xFF,0xE0,0xFD,0xFB,0xF7,0xE0, // z
0xF9,0xF7,0xF7,0xE7,0xF7,0xF7,0xF9, // {
0xFB,0xFB,0xFB,0xFF,0xFB,0xFB,0xFB, // |
0xF3,0xFD,0xFD,0xFC,0xFD,0xFD,0xF3, // }
0xF5,0xEA,0xFF,0xFF,0xFF,0xFF,0xFF}; // ~
//------------------------------------------------------------------
//------------------------------------------------------------------
#INT_RDA
void LETRERO(){
salida:
valor=getc();//recibe el dato del pc y lo guarda en valor
valor1=valor;
/////////////////////codigo del pc
}
void main(){
enable_interrupts(global);
enable_interrupts(int_rda);
//LETRERO();
//////////////////////////////////////////////////////////////////////////////////
switch (valor){
//------------------------------------------------------------------RUTA 1
case 'a':
char TEXT []={" RUTA 1 "};
while(true){
valor=getc();
for(j=0;j<8;){
for(i=d;i<d+8;i++){
if (TEXT <='?')DATA=~FONT1[TEXT -' '][j];
else
if (TEXT <='_')DATA=~FONT2[TEXT -'@'][j];
else
if (TEXT <='~')DATA=~FONT3[TEXT -'`'][j];
if(j==7)DATA=0x00;
for(k=0;k<8;k++){
OUTPUT_BIT(PIN_A1,shift_left(&DATA,1,0));
if(k>=2){
OUTPUT_HIGH(PIN_A0);
OUTPUT_LOW (PIN_A0);
OUTPUT_HIGH(PIN_A0);
OUTPUT_LOW (PIN_A0);
}
}
}
//demo
if(s&8)
OUTPUT_HIGH(PIN_A3);
else
OUTPUT_HIGH(PIN_A2);
delay_ms(2);
OUTPUT_LOW (PIN_A2);OUTPUT_LOW (PIN_A3);
OUTPUT_B(s+=1);
if(z)j++;
z=!z;
}
m+=1;
if(m==2){m=0;n+=1;};
if(n==12){n=0;d+=1;}
if(d==20)d=0;
}
break;
//------------------------------------------------------------------RUTA 2
case 'b':
char TEXT1 []={" RUTA 2 "};
while(true){
for(j=0;j<8;){
for(i=d;i<d+8;i++){
if (TEXT1 <='?')DATA=~FONT1[TEXT1 -' '][j];
else
if (TEXT1 <='_')DATA=~FONT2[TEXT1 -'@'][j];
else
if (TEXT1 <='~')DATA=~FONT3[TEXT1 -'`'][j];
if(j==7)DATA=0x00;
for(k=0;k<8;k++){
OUTPUT_BIT(PIN_A1,shift_left(&DATA,1,0));
if(k>=2){
OUTPUT_HIGH(PIN_A0);
OUTPUT_LOW (PIN_A0);
OUTPUT_HIGH(PIN_A0);
OUTPUT_LOW (PIN_A0);
}
}
}
//demo
if(s&8)
OUTPUT_HIGH(PIN_A3);
else
OUTPUT_HIGH(PIN_A2);
delay_ms(2);
OUTPUT_LOW (PIN_A2);OUTPUT_LOW (PIN_A3);
OUTPUT_B(s+=1);
if(z)j++;
z=!z;
}
m+=1;
if(m==2){m=0;n+=1;};
if(n==12){n=0;d+=1;}
if(d==20)d=0;
valor=getc();
}
break;
}
}