TODOPIC
Microcontroladores PIC => Lenguaje C para microcontroladores PIC => Mensaje iniciado por: garopa en 07 de Mayo de 2007, 21:44:47
-
#include <16f84A.h> //pic a utilizar
#fuses XT,NOWDT,NOPROTECT,PUT //ordenes pBrB el programador
#use delay (clock=4000000) //Fosc=4Mhz
#use standard_io(B) //puerto B como salida
main (){
while (1){
set_tris_b(0x00); //portB todo como salida
disable_interrupts(GLOBaL); //
output_high(PIN_B0);
output_low(PIN_B1);
delay_ms(500);
output_low(PIN_B0);
output_high(PIN_B1);
delay_ms(500);
if (PIN_B1==1){
output_low(PIN_B0);
}
}
}
Gente una pregunta esta bien asi hecho el condicional
if (PIN_B1==1){
output_low(PIN_B0);
}
-
Corrige el condicional:
if (INPUT(PIN_B1)==1) {
o incluso así:
if (INPUT(PIN_B1)) {