udea rf

Başlatan koordinat, 11 Mart 2009, 00:24:43

koordinat

1)tek pic ile arx-atx34 ü çalıştırmak mümkün mü çünkü rs232 gibi verileri yolluyoruz.anlamadım kafam karıştı biraz denedim receive sinyali yanıp sönüyor  :roll:

#include <16F877A.H>
#fuses HS, NOWDT, NOPROTECT, NOBROWNOUT, NOLVP, NOPUT, NOWRT, NODEBUG, NOCPD 
#use delay(clock=20000000) 
#use rs232(baud=1200, xmit=PIN_C6,rcv=PIN_C7) 

int say1=0,say2=0;

void main() 
{ 

while(1) 
{ 
putc(0x55);putc(0x55);putc(0x55);putc(0x55);putc(0x55); 
putc(0x00);putc(0x00);putc(0x00);putc(0x00);putc(0x00); 
putc(0xff);putc(0xff);putc(0xff);putc(0xff);putc(0xff); 
putc(0x66);putc(0x66);putc(0x66);putc(0x66);putc(0x66);
putc(0x66);putc(0x66);putc(0x66);putc(0x66);putc(0x66);
putc(0x66);putc(0x66);putc(0x66);putc(0x66);putc(0x66);

if (input(pin_B0)==1){putc (0x66);putc (0x66);}
 


  
if(getc()==0x00) {say1++; if(say1>=5) {say1=0;} 
 
      { 
if(getc()==0xff) {say2++; if(say2>=5) {say2=0;}
if(getc()==0x66) {output_high(pin_d1); delay_ms(50); output_low(pin_d1);} }
      } 
                 }
  
}
}

2)udea ccs kodu olan varmı bendeki sadece basit bi kod
  bunu nasıl geliştirebilirim?
#use rs232(baud=2400, xmit=PIN_C6) 

void main() 
{ 

while(1) 
{ 
putc(0x55);putc(0x55);putc(0x55);putc(0x55);putc(0x55); 
putc(0x00);putc(0x00);putc(0x00);putc(0x00);putc(0x00); 
putc(0xff);putc(0xff);putc(0xff);putc(0xff);putc(0xff); 

if (input(pin_B0)==1){putc (0x66);putc (0x66);}
} 
}
#include <16F877A.H>
#fuses HS, NOWDT, NOPROTECT, NOBROWNOUT, NOLVP, NOPUT, NOWRT, NODEBUG, NOCPD 
#use delay(clock=20000000) 
#use rs232(baud=2400, rcv=PIN_C7) 
int say1=0,say2=0; 

void fivebyte0() 
{ 
while(1) 
 { 
if(getc()==0x00) {say1++; if(say1>=5) {say1=0;} 

while(1) 
      { 
if(getc()==0xff) {say2++; if(say2>=5) {say2=0;}
if(getc()==0x66) {output_high(pin_d1); delay_ms(50); output_low(pin_d1);} }
      } 
                 }
 } 
} 
////////////////////////////////////////////////////////////////////////////////
void main() 
{ 

while(1) 
 {
 fivebyte0();
 
 }

}