標(biāo)題: BASCOM AVR 版 RC5紅外發(fā)射與接收遙控仿真 [打印本頁]

作者: taotie    時(shí)間: 2019-12-22 16:15
標(biāo)題: BASCOM AVR 版 RC5紅外發(fā)射與接收遙控仿真
仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)


單片機(jī)源程序如下:
  1. rem Main.bas file generated by New Project wizard
  2. rem  RC5編碼發(fā)射
  3. rem Created:   周六 12月 21 2019   taotie
  4. rem Processor: ATmega8
  5. rem Compiler:  BASCOM-AVR

  6. rem Write your code here

  7. $regfile ="m8def.dat"
  8. $crystal =8000000

  9. DDRD=&B00000000
  10. PORTD=&B11111111

  11.   main:
  12.   do

  13.   if pind.0=0 then Rc5send  0 , 0,1
  14.   waitms 80
  15. if pind.0=0 then Rc5send  0, 0,1
  16.   waitms 80

  17.   
  18.   if pind.1=0 then Rc5send 0,0,2
  19.   waitms 80
  20. if pind.1=0 then Rc5send 0,0,2
  21.   waitms 80

  22.    
  23.   if pind.2=0 then Rc5send 0,0,3
  24.   waitms 80
  25. if pind.2=0 then Rc5send 0,0,3
  26.   waitms 80

  27.    
  28.   if pind.3=0 then Rc5send 0,0,4
  29.   waitms 80
  30. if pind.3=0 then Rc5send 0,0,4
  31.   waitms 80

  32.    
  33.   if pind.4=0 then Rc5send 0,0,5
  34.   waitms 80
  35.   if pind.4=0 then Rc5send 0,0,5
  36.   waitms 80
  37.   loop
  38.   end
復(fù)制代碼

所有資料51hei提供下載:
rc5.zip (363.09 KB, 下載次數(shù): 47)


作者: taotie    時(shí)間: 2020-1-17 14:50






歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1