Documentos de Académico
Documentos de Profesional
Documentos de Cultura
#include <xc.h>
#define _XTAL_FREQ 4000000
void main(void)
{
int c = 0;
TRISC = 0x00; /* PUERTO C COMFIGURADO COMO SALIDA
* TRISC = 0b00000000; */
PORTC = 0b00000001;
while (c<=7)
{
__delay_ms(500);
PORTC = (PORTC<<1);
c = c+1;
}
PORTC = 0b10000000;
c = 0;
}
if (IZQ == 0)
{
PORTC = 0b10000000;
while (c<=7)
{
__delay_ms(500);
PORTC = (PORTC>>1);
c = c+1;
}
PORTC = 0b00000001;
c = 0;
}
if (TODO == 0)
{
PORTC = 0b00000001;
while (c<7)
{
__delay_ms(500);
PORTC = (PORTC<<1);
c=c+1;
}
while (c<14)
{
__delay_ms(500);
PORTC = (PORTC>>1);
c=c+1;
}
if (c==14)
{
PORTC = 0b00000001;
}
c = 0;
}
}
return;
}