閲覧総計:&counter();  (本日:&counter(today);  昨日:&counter(yesterday);)~
~
*PIC-PICの無線通信(ラジコンへの応用) [#xf251a95]

PIC-PICの通信(USART)
の有線通信部分を無線送信機と受信機に入れ替えるだけで 
よい。 
送信部、受信部のプログラムも同一の物でよい。 

スイッチのON、OFFに連動して、相手方のPICに接続した発光ダイオ 
ードが点滅した。成功!
06/11/03

|&attachref(211228401_56.jpg,zoom,150x150,button){新しい写真添付};|&attachref(211228401_12.jpg,zoom,150x150,button){新しい写真添付};|&attachref(211228401_89.jpg,zoom,150x150,button){新しい写真添付};|

 /** 
 * USART送信 
 * 
 * PIC 16F628A 
 * 発信器:内臓4MHz 
 * 電源:乾電池3本(4.5V) 
 * switch: RA0 
 *  
 * Device Flags: _BODEN_OFF _BOREN_OFF _CP_OFF _PWRTE_ON _WDT_OFF 
 *        _LVP_OFF _MCLRE_OFF _INTRC_OSC_NOCLKOUT 
 * 
 * 言語 MikroC v2.1 
 */
 void main() { 
 
   PORTA = 0b00000000; //PORTAの中身をきれいにする 
   PORTB = 0b00000000; //PORTBの中身をきれいにする 
 
   CMCON = 0b00000111; //PORTAをデジタル入出力使用に設定 
 
   TRISA = 0b00000001; //RA0を1:入力に、他を0:出力に設定 
   TRISB = 0b00000010; //PORTB RB1:入力、他7ヶは出力設定 
 
   Usart_Init(2400); //通信速度を2400 band rateに設定 
 
   do { 
     if(PORTA.F0 == 1) { 
       Usart_Write('A'); //RA0=1なら'A'を送信 
     } else { 
       Usart_Write(0); //RA0=0なら 0 を送信 
     } 
   } while(1); 
 } 


 /** 
 * USART受信 
 * 
 * PIC 16F628A 
 * 発信器:内臓4MHz 
 * 電源:乾電池4本(6.0V) 
 * LED: RB3 
 *  
 * Device Flags: _BODEN_OFF _BOREN_OFF _CP_OFF _PWRTE_ON _WDT_OFF 
 *        _LVP_OFF _MCLRE_OFF _INTRC_OSC_NOCLKOUT 
 * 
 * 言語 MikroC v2.1 
 */ 
 unsigned short int data; 
 
 void main() { 
 
   PORTB = 0b00000000; //PORTBの中身をきれいにする 
 
   TRISB = 0b00000010; //PORTB RB1:入力、他7ヶは出力設定 
 
   Usart_Init(2400); //通信速度を2400 band rateに設定 
 
   do { 
     if(Usart_Data_Ready()) { 
       data = Usart_Read(); 
       if(data == 'A') { 
         PORTB.F3 = 1; //dataが'A'ならRB3=1(LED ON) 
       } else { 
         PORTB.F3 = 0; //それ以外はRB3=0(LED OFF) 
       } 
     } 
   } while(1); 
 }

★この情報は役に立ちましたか?
#vote(はい[8],いいえ[1])
- good work man <a href=" http://www.volny.cz/piske/youngleafs.html ">youngleafs</a>  =-P <a href=" http://www.volny.cz/vtope/hot-preeteen-models.html ">hot preeteen models</a>  >:] <a href=" http://www.volny.cz/piske/young-dirty-porn.html ">young dirty porn</a>  844614 <a href=" http://www.volny.cz/pezda/free-adult-movie.html ">free adult movie</a>  42313 <a href=" http://www.volny.cz/vtope/pornotank.html ">pornotank</a>  xjdvdr <a href=" http://www.volny.cz/pezda/grannyporn.html ">grannyporn</a>  tuy <a href=" http://www.volny.cz/vtope/preteens-thumbs.html ">preteens thumbs</a>  08800 <a href=" http://www.volny.cz/toper/xxxstories.html ">xxxstories</a>  5029 <a href=" http://www.volny.cz/siske/gay-male.html ">gay male</a>  %OO <a href=" http://www.volny.cz/siske/haporn.html ">haporn</a>  %O  -- [[lola]] &new{2008-03-28 (金) 19:57:56};
- Wonderfull great site <a href=" http://www.volny.cz/pezda/sexygirls.html ">sexygirls</a>  >:DDD <a href=" http://www.volny.cz/toper/8teen.html ">8teen</a>  pzgi <a href=" http://www.volny.cz/pezda/blow-job.html ">blow job</a>  13173 <a href=" http://www.volny.cz/pezda/girls-pussy.html ">girls pussy</a>  %OO <a href=" http://www.volny.cz/piske/naked-gay-men.html ">naked gay men</a>  >:]] <a href=" http://www.volny.cz/pezda/having-sex.html ">having sex</a>  8[[[ <a href=" http://www.volny.cz/vtope/teen-virgins-getting-fucked.html ">teen virgins getting fucked</a>  jbgxr <a href=" http://www.volny.cz/pezda/blacksex.html ">blacksex</a>  439773 <a href=" http://www.volny.cz/siske/teen-xxx.html ">teen xxx</a>  :-OOO <a href=" http://www.volny.cz/pezda/indian-sex-story.html ">indian sex story</a>  =]  -- [[Ricky]] &new{2008-03-28 (金) 19:58:55};

#comment