Professional Documents
Culture Documents
h>
#fuses HS, NOWDT
#use delay(clock=4M)
//!#define use_portb_kbd TRUE
//!#include <KBD4x4.c>
//.............................................................................
int barrido[]={0b00000001,
0b00000010,
0b00000100,
0b00001000,
0b00010000,
0b00100000,
0b01000000,
0b10000000};
int nro1[]={0b00011000,
0b00111000,
0b01011000,
0b00011000,
0b00011000,
0b00011000,
0b00011000,
0b01111110};
int nro2[]={0b01111110,
0b01111110,
0b00000110,
0b01111110,
0b01111110,
0b01100000,
0b01111110,
0b01111110};
int nro3[]={0b01111110,
0b01111110,
0b00000110,
0b00011110,
0b00011110,
0b00000110,
0b01111110,
0b01111110};
int nro4[]={0b01100110,
0b01100110,
0b01100110,
0b01111110,
0b01111110,
0b00000110,
0b00000110,
0b00000110};
int nro5[]={0b01111110,
0b01111110,
0b01100000,
0b01111110,
0b01111110,
0b00000110,
0b01111110,
0b01111110};
int nro6[]={0b01111110,
0b01111110,
0b01100000,
0b01111110,
0b01111110,
0b01100110,
0b01111110,
0b01111110};
int nro7[]={0b01111110,
0b01111110,
0b00000110,
0b00000110,
0b00000110,
0b00000110,
0b00000110,
0b00000110};
int nro8[]={0b01111110,
0b01111110,
0b01100110,
0b01111110,
0b01111110,
0b01100110,
0b01111110,
0b01111110};
int nro9[]={0b01111110,
0b01111110,
0b01100110,
0b01111110,
0b01111110,
0b00000110,
0b00000110,
0b00000110};
int nro0[]={0b01111110,
0b01111110,
0b01100110,
0b01100110,
0b01100110,
0b01100110,
0b01111110,
0b01111110};
int mas[]={0b00011000,
0b00011000,
0b00011000,
0b11111111,
0b11111111,
0b00011000,
0b00011000,
0b00011000};
int igual[]={0b00000000,
0b11111111,
0b11111111,
0b00000000,
0b00000000,
0b11111111,
0b11111111,
0b00000000};
//......................PROTOTIPOS.............................................
void configuracion();
void mostrar(char dato);
//.............................................................................
void main()
{
configuracion();
while(true)
{
mostrar('0');
mostrar('1');
mostrar('2');
mostrar('3');
mostrar('4');
mostrar('5');
mostrar('6');
mostrar('7');
mostrar('8');
mostrar('9');
mostrar('+');
mostrar('=');
}
}
void configuracion()
{
set_tris_b(0b00000000);
set_tris_d(0b00000000);
setup_adc_ports(NO_ANALOGS);
}