16f84a pic 1 ta input signal1 deela output1 labagenima sada program1 liyanne kohomada?saralawa pehedili kara denna
[ Post made via Mobile Device ]
How to use single input & output on 16F84A microcontroler
Re: How to use single input & output on 16F84A microcontroler
C valin liyannamko...
Code: Select all
// All standard C includes comes here based on your compiler
// For HI-TECH C, it would be either #include <pic.h> or #include <htc.h>
// Optional: General settings/flags go here
int main (){
TRISA = 0xFF; // All pins on PORT A are inputs
TRISB = 0x00; // All pins on PORT A are outputs
PORTB = 0x00;
while (1){
if (RA0 == 1){ // Check whether RA0 pin is high on PORT A
RB0 = 1; // Make the RB0 pin high on PORT B
}
else{
RB0 = 0; // Make RB0 pin low on PORT B
}
}
return 0;
}