kodlar ccs c derleyicisinde yazılmıştır. iyi çalışmalar....
verici_____
#INCLUDE <16F876.H>
/*_____________________PİC SİGORTA____________________________*/
/*___________433MHz rf modul programı verici ünitesi__________*/
/*____Tacettin ÇIRACI_____temmuz 2007________________*/
#FUSES NOWDT //No Watch Dog Timer
#FUSES XT
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#byte porta=5
/*____________________________KRİSTAL______________ ________________*/
#use delay(clock=4000000)
#use rs232(baud=1200, xmit=PIN_C6,rcv=PIN_C7)
uyandir()
{
printf("0x55");
printf("0x55");
printf("0x55");
printf("0x55");
printf("0x55");
printf("0x00");
printf("0x00");
printf("0x00");
printf("0x00");
printf("0x00");
printf("0xff");
printf("0xff");
printf("0xff");
printf("0xff");
printf("0xff");
putc('x');
}
main()
{
while(1)
{
uyandir();
putc('A');
delay_ms(500);
uyandir();
putc('B');
delay_ms(500);
}
}
alıcı____
#INCLUDE <16F876.H>
/*_____________________PİC SİGORTA____________________________*/
/*___________433MHz rf modul programı alıcı ünitesi__________*/
#FUSES NOWDT //No Watch Dog Timer
#FUSES XT
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
/*____________________________KRİSTAL______________ ________________*/
#use delay(clock=4000000)
#use rs232(baud=1200, xmit=PIN_C6,rcv=PIN_C7)
int gelen;
main()
{
set_tris_b(0x00);
OUTPUT_B(0x00);
OUTPUT_B(0x00);
output_high(PIN_B1);
while(1)
{
if(getc()=='x') //öncü veriyi aldıysan
{
gelen=getc(); //gönderdiğim veriyi al
switch (gelen)
{
case 'A': output_high(PIN_B0);break;
case 'B': output_low(PIN_B0);break;
}
}
}
}