标题: BASCOM AVR 版 RC5红外发射与接收遥控仿真 [打印本页]

作者: taotie    时间: 2019-12-22 16:15
标题: BASCOM AVR 版 RC5红外发射与接收遥控仿真
仿真原理图如下(proteus仿真工程文件可到本帖附件中下载)


单片机源程序如下:
  1. rem Main.bas file generated by New Project wizard
  2. rem  RC5编码发射
  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
复制代码

所有资料51hei提供下载:
rc5.zip (363.09 KB, 下载次数: 47)


作者: taotie    时间: 2020-1-17 14:50






欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1