单片机源程序如下:
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
『本文转载自网络,版权归原作者所有,如有侵权请联系删除』