Вы находитесь на странице: 1из 1

/* el siguiente programa conectado al display hace que este cuente de 0 a 3 y se

vuelva a repetir*/
unsigned int Dato=0;
unsigned int i;
const int tiempo=500;
void main()
{
OPTION_REG.F7=0; //RESISTENCIA DE PULL-UP
TRISB=0b00000000;
//CONFIGURAR EL PORTB COMO SALIDA
PORTB=0;
while(1)
{
PORTB=0b011111110;
//digito 0
Delay_ms(tiempo);
PORTB=0x30;
//digito 1
Delay_ms(tiempo);
PORTB=0x6D;
//digito 2
Delay_ms(tiempo);
PORTB=0x79;
//digito 3
}
}

Вам также может понравиться