BASCOM AVR 版 RC5红外发射与接收遥控
2020-09-16 来源:51hei
单片机源程序如下:
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
相关文章