×
单片机 > 单片机程序设计 > 详情

BASCOM AVR 版 RC5红外发射与接收遥控

发布时间:2024-05-03 发布时间:
|

单片机源程序如下:

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



『本文转载自网络,版权归原作者所有,如有侵权请联系删除』

热门文章 更多
STM32中断向量表的位置.重定向