ERSA جان واقعا ممنون از راهنماییت
پروژه من فرستنده و گیرنده مادون قرمز ه و سمت فرستنده از attiny26 استفاده کردم
کد برنامه اینه
نقل قول:
$regfile = "attiny26.dat"
$crystal = 8000000
Config Porta = Input
Config Portb = Input
Open "COMb.4:2400,8,n,1,inverted"for Output As #2
Config Int0 = Low Level
Enable Interrupts
Enable Int0
On Int0 Ex0_int
Dim B As Bit
Dim C As Bit
Dim A1 As Byte
Dim A2 As Byte
Do
Powerdown
Loop
End
Ex0_int:
C = 1
A1 = Pina
A2 = Pinb
A2 = A2 And &B00101111
If A2 = &H00 Then
B = 1
Select Case A1
Case 1:
Printbin #2 , 7
Case 2:
Printbin #2 , 4
Case 4:
Printbin #2 , 1
Case 8:
Printbin #2 , 10
Case 16:
Printbin #2 , 2
Case 32:
Printbin #2 , 3
Case 64:
Printbin #2 , 12
C = 0
Case 128:
Printbin #2 , 9
Case Else
B = 0
End Select
End If
If A1 = &H00 Then
B = 1
Select Case A2
Case 1:
Printbin #2 , 13
Case 2:
Printbin #2 , 11
C = 0
Case 4:
Printbin #2 , 8
Case 8:
Printbin #2 , 5
Case 32:
Printbin #2 , 6
Case Else
B = 0
End Select
End If
If B = 1 Then Waitms 40
If C = 0 Then Waitms 40
Return
خط printbin #2 , 7 و خط printbin #2 , 4 ارور میده
میشه لطفا راهنماییم کنی
ارورشم اینه channel expected