Dim Address As Byte , Command As Byte
Config Rc5 = Pinc.6
Config Portb = Output
Enable Interrupts
Do
Getrc5(address , Command)
Print "asd"
If Address = 5 Then
If Command = 1 Then Set Portb.0
If Command = 2 Then Reset Portb.0
End If
Loop
کد فرستنده :
' in the name of GOD
' SENDER UNIT
$regfile = "m8def.dat"
$crystal = 8000000
Config Portc = Input
Config Debounce = 30
Dim Togbit As Byte , Command As Byte , Address As Byte
Togbit = 0
Address = 0
Hamed:
Do
Debounce Pinc.6 , 1 , Comm
Debounce Pinc.6 , 0 , Comm2
Loop
End
پاسخ : :::::: کوچکترین میکرو و سنسور ؟ ::::::::::::::
سلام.
خوبی آقا؟؟
چقدر عجله داری؟؟؟
خوب تو برنامه گیرنده که مشخص هستش ورودی کدام پایه از میکرو هست؟ چون خودت تو برنامه مشخص کردی Config Rc5 = Pinc.6
تو فرستنده هم خیلی واضح هستش به شرطی که help رو میخوندی. خروجی میکرو رو باید از پین OC1A بگیری که تو mega8 پایه شماره 15 میباشد.
برق میکرو هم که پایه های 7 و 8 هستش.
راستی کریستال خارجی 16 مگ میذاری؟؟؟
Dim Address As Byte , Command As Byte
Config Rc5 = Pinc.6
Config Portb = Output
Enable Interrupts
Do
Getrc5(address , Command)
If Address = 5 Then
If Command = 1 Then Portb.0 = 1
If Command = 2 Then Portb.0 = 0
End If
Loop
دیدگاه