Ejemplo de un pae familiar comunitario
#include
__PIC16f84;
__PIC_CLK=4000000;
#define _XTAL_FREQ 4000000 main(){ TRISA=0; TRISB=0; PORTA=0; PORTB=0; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=1; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=2; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=3; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=4; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=5; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=6; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=7; …ver más…
n cycles CLRWDT(); PORTB=6; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=7; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=8; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=9; __delay_ms(1000); // delay for 1000 instruction cycles
PORTB=0; PORTA=5;
__delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=1; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=2; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=3; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=4; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=5; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=6; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=7; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=8; __delay_ms(1000); // delay for 1000 instruction cycles CLRWDT(); PORTB=9;