هذا الرابط لملف المحاكاه وملف الهكيس
تحميل الملف من هنا
وهذه هي الاكواد
كود المايكرو المخصص للاستقبال
كود:
device = 16f877a
xtal 4
dim i as byte
dim ir_word as word
dim vl as word
dim id as byte
dim st as word
DECLARE LCD_DTPIN PORTd.4
DECLARE LCD_ENPIN PORTd.3
DECLARE LCD_INTERFACE 4
DECLARE LCD_RSPIN PORTd.2
input portb.0
main:
if vl=252 then
print at 1,1,"1 "
endif
if vl=8184 then
print at 1,1,"2 "
endif
if vl=16188 then
print at 1,1,"3 "
endif
if vl=32252 then
print at 1,1,"4 "
endif
if vl=63480 then
print at 1,1,"5 "
endif
if vl=61412 then
print at 1,1,"6 "
endif
if vl=65436 then
print at 1,1,"7 "
endif
if vl=57148 then
print at 1,1,"8 "
endif
if vl=65276 then
print at 1,1,"9 "
endif
if vl=0 then
print at 1,1,"0 "
endif
st=pulsin portb.0 ,1
if st < 200 then goto main
if st > 270 then goto main
for i=0 to 15
id=pulsin portb.0 ,1
If ID>50 then
IR_Word.0=1
Else
IR_Word.0=0
Endif
ir_word=ir_word<<1
next i
vl = ir_word
ir_word=0
;print at 1,1,dec vl," "
goto main
وهذا كود المايكرو المخصص للارسال
كود:
device = 16f877a
xtal 4
dim i as byte
dim ir_word as word
dim id as word
dim mm as byte
dim iir as byte
output portc.1
DECLARE KEYPAD_PORt portb
dim var1 as byte
dim key as byte
main:
key=0
VAR1 = INKEY
if var1=16 then goto main
DELAYMS 250
KEY = LOOKUP VAR1, ["1","2","3"," ","4","5","6"," ","7","8","9"," ","*","0","#"," "]
if key ="1" then iir=1
if key ="2" then iir=2
if key ="3" then iir=3
if key ="4" then iir=4
if key ="5" then iir=5
if key ="6" then iir=6
if key ="7" then iir=7
if key ="8" then iir=8
if key ="9" then iir=9
if key ="0" then iir=0
portc.1=1
delayms 2.4
for i=0 to 15
mm=iir*i*0.1
portc.1 =1
delayms mm
portc.1 =0
delayms 0.4
next i
طبعا قمت بالتوصيل ما بين المايكرو بالواير لعدم توفر ir sensor
ارجو ان تعمل الدائره كما هي في الحقيقه