仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)
捕獲.PNG (365.83 KB, 下載次數: 118)
下載附件
2019-12-22 16:14 上傳
單片機源程序如下:
- rem Main.bas file generated by New Project wizard
- rem RC5編碼發射
- rem Created: 周六 12月 21 2019 taotie
- rem Processor: ATmega8
- rem Compiler: BASCOM-AVR
- rem Write your code here
- $regfile ="m8def.dat"
- $crystal =8000000
- DDRD=&B00000000
- PORTD=&B11111111
-
- main:
- do
- if pind.0=0 then Rc5send 0 , 0,1
- waitms 80
- if pind.0=0 then Rc5send 0, 0,1
- waitms 80
-
- if pind.1=0 then Rc5send 0,0,2
- waitms 80
- if pind.1=0 then Rc5send 0,0,2
- waitms 80
-
- if pind.2=0 then Rc5send 0,0,3
- waitms 80
- if pind.2=0 then Rc5send 0,0,3
- waitms 80
-
- if pind.3=0 then Rc5send 0,0,4
- waitms 80
- if pind.3=0 then Rc5send 0,0,4
- waitms 80
-
- if pind.4=0 then Rc5send 0,0,5
- waitms 80
- if pind.4=0 then Rc5send 0,0,5
- waitms 80
- loop
- end
復制代碼
所有資料51hei提供下載:
rc5.zip
(363.09 KB, 下載次數: 47)
2019-12-22 16:15 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
|