Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Bucle Switch:
Se utiliza cuando se tienen múltiples condiciones.
Montar el siquiente circuito de proteus.
Escribir los siguientes códigos de práctica, compilarlos, ejecutarlos en proteus y/o grabarlos en el
microcontrolador.
Código 1: Encender juegos de Leds indefinidamente
#include <16F84A.h>
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz)
#use delay(clock=10000000)
void main()
{
output_B(0b00000000); // Pines del puerto apagado
while(true) //Bucle infinito
{
output_high(Led1); //Encender el led1
delay_ms(demora); //Esperar 1 seg
output_high(Led2); //Encender el led2
output_low(Led1); //Apagar el led1
delay_ms(demora); //Esperar 1 seg
output_high(Led3); //Encender el led3
output_low(Led2); //Apagar el led2
delay_ms(demora); //Esperar 1 seg
output_high(Led4);
output_low(Led3);
delay_ms(demora);
output_high(Led5);
output_low(Led4);
delay_ms(demora);
output_low(Led5);
delay_ms(demora);
}
}
#include <16F84A.h>
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (>4mhz)
#use delay(clock=10000000)
#include <16F84A.h>
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz)
#use delay(clock=10000000)
#include <16F84A.h>
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz)
#use delay(clock=10000000)