//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//Code Support : Board Trainning $
//Compiler : PIC C Compiler Version 3.245 $
//Micro Controller : PIC16F877 $
//OSC : 10MHz $
// WWW.MECHATRONICS-LAB.COM $
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
#include <16F877.h>
#fuses HS,NOLVP,NOWDT,NOPROTECT
#use delay (clock = 10000000) // Crytal = 10MHz
#use fast_io(B)
#use fast_io(D)
//----------------------------------------------------
int8 a;
//----------------------------------------------------
//****************************************************************************
void main()
{
//-------------------------------------------------
set_tris_b(0xFF); // 1111 1111 PortB is Input
set_tris_d(0x00); // 0000 0000 PortD is Output
port_b_pullups(true);
//-------------------------------------------------
while (TRUE)
{
a = input_b();
output_d(a);
}
}
//****************************************************************************
ไม่มีความคิดเห็น:
แสดงความคิดเห็น