GlenLivet
22.03.2006, 15:37
Hallo
Kann mir Jemand weiter helfen wo es bei mir Hackt? Hab 2 Mega16 so programmiert. Aber der Slave macht nix. Woran liegt es?
Master:
$regfile = "m16def.dat"
$crystal = 1000000
$baud = 9600
Dim A As Byte
Dim B As Byte
Dim C As Byte
Dim D As Byte
Open "comd.2:2400,8,n,1,inverted" For Output As #1
Open "comd.3:2400,8,n,1,inverted" For Input As #2
Config Porta = Input
A = 200
B = 100
C = 1
D = 201
Do
If Pina.0 = 0 Then
Printbin #1 , A
Printbin #1 , B
Printbin #1 , C
Printbin #1 , D
End If
Loop
Close #1
Close #2
End
Slave:
$regfile = "m16def.dat"
$crystal = 1000000
$baud = 9600
Led1 Alias Porta.0
Config Porta = Output
Dim A As Byte
Dim B As Byte
Dim C As Byte
Dim E As Byte
Open "comd.3:2400,8,n,1,inverted" For Output As #1
Open "comd.2:2400,8,n,1,inverted" For Input As #2
Do
Ende:
A = Waitkey(#2)
If A = 200 Then
Porta.1 = 1
B = Waitkey(#2)
End If
If B = 100 Then
Set Led1
Waitms 500
Reset Led1
Goto Ende
End If
Loop
Close #1
Close #2
End
Bitte Hellft mir!!!!!!
Kann mir Jemand weiter helfen wo es bei mir Hackt? Hab 2 Mega16 so programmiert. Aber der Slave macht nix. Woran liegt es?
Master:
$regfile = "m16def.dat"
$crystal = 1000000
$baud = 9600
Dim A As Byte
Dim B As Byte
Dim C As Byte
Dim D As Byte
Open "comd.2:2400,8,n,1,inverted" For Output As #1
Open "comd.3:2400,8,n,1,inverted" For Input As #2
Config Porta = Input
A = 200
B = 100
C = 1
D = 201
Do
If Pina.0 = 0 Then
Printbin #1 , A
Printbin #1 , B
Printbin #1 , C
Printbin #1 , D
End If
Loop
Close #1
Close #2
End
Slave:
$regfile = "m16def.dat"
$crystal = 1000000
$baud = 9600
Led1 Alias Porta.0
Config Porta = Output
Dim A As Byte
Dim B As Byte
Dim C As Byte
Dim E As Byte
Open "comd.3:2400,8,n,1,inverted" For Output As #1
Open "comd.2:2400,8,n,1,inverted" For Input As #2
Do
Ende:
A = Waitkey(#2)
If A = 200 Then
Porta.1 = 1
B = Waitkey(#2)
End If
If B = 100 Then
Set Led1
Waitms 500
Reset Led1
Goto Ende
End If
Loop
Close #1
Close #2
End
Bitte Hellft mir!!!!!!