Secuencia de leds
3
Encender y apagar un led #include<18f2550.h> #use delay(clock=8000000) void main(void) { output_high(pin_b0); delay_ms(60000); output_low(pin_b0); delay_ms(60000); }
-
Upload
harold-beltran -
Category
Documents
-
view
215 -
download
1
description
programacion para encendido de leds
Transcript of Secuencia de leds
Encender y apagar un led
#include<18f2550.h>
#use delay(clock=8000000)
void main(void)
{
output_high(pin_b0);
delay_ms(60000);
output_low(pin_b0);
delay_ms(60000);
}
SECUENCIA DE LEDS #include<18f2550.h>
//#fuses
#use delay(clock=8000000)
int x=1,aux[20];
void main(void)
{
aux[1]=0b00000001;
aux[2]=0b00000010;
aux[3]=0b00000100;
aux[4]=0b00001000;
aux[5]=0b00010000;
aux[6]=0b00100000;
aux[7]=0b01000000;
aux[8]=0b10000000;
aux[9]=0b01000000;
aux[10]=0b00100000;
aux[11]=0b00010000;
aux[12]=0b00001000;
aux[13]=0b00000100;
aux[14]=0b00000010;
aux[15]=0b00000001;
aux[16]=0b00000000;
aux[17]=0b11111111;
aux[18]=0b00000000;
aux[19]=0b11111111;
while(true)
{
for(x=1;x<=19;x++)
{
output_b(aux[x]);
delay_ms(100);
}
}