Hi, es funktioniert Trotzdem net! selbst wenn ich beide Masse pole Verbinde vom Akku und vom Netzteil 
Hier mal mein Code:
Code:
$regfile = "m32def.dat" ' specify the used micro
$crystal = 16000000 ' used crystal frequency 16mHz
$framesize = 80
$hwstack = 80
$swstack = 80
$baud = 9600
Config Porta.0 = Output
Config Porta.1 = Output
Config Porta.2 = Output
Config Porta.3 = Output
Config Porta.4 = Output
Config Porta.5 = Output
Config Porta.6 = Output
Flashlinks Alias Porta.0
Flashrechts Alias Porta.1
Baconheck Alias Porta.2
Flashheck Alias Porta.3
Landescheinwerfer Alias Porta.4
Posilightlirot Alias Porta.5
Posilightregruen Alias Porta.6
Timer1 = 3000
Config Timer1 = Timer , Prescale = 8
Enable Timer1
Stop Timer1
On Timer1 Flash
Gosub Flashoff
Gosub Landescheinwerferoff
Gosub Posilightsoff
Dim V As Byte
Dim Flasher As Byte
Dim Posi As Byte
Declare Sub Flash
Config Timer2 = Timer , Prescale = 128
Start Timer2
Dim Start1 As Byte
Dim Stop1 As Byte
Dim Impuls1 As Byte
Dim Flag1 As Bit
Dim Start2 As Byte
Dim Stop2 As Byte
Dim Impuls2 As Byte
Dim Flag2 As Bit
Config Int0 = Change
On Int0 Impuls1
Enable Int0
Config Int1 = Change
On Int1 Impuls2
Enable Int1
Enable Interrupts
Start Timer1
Do
Gosub Flashon
Gosub Landescheinwerferoff
Gosub Posilightsoff
If Flag1 = 1 Then
Flag1 = 0
Impuls1 = Stop1 - Start1
Print Impuls1
End If
If Flag2 = 1 Then
Flag2 = 0
Impuls2 = Stop2 - Start2
Print Impuls2
End If
Loop
Impuls1:
If Pind.2 = 1 Then
Start1 = Timer2
Else
Stop1 = Timer2
Flag1 = 1
End If
Return
Impuls2:
If Pind.3 = 1 Then
Start2 = Timer2
Else
Stop2 = Timer2
Flag2 = 1
End If
Return
Flash:
Stop Timer1
If V = 0 Then
Set Flashlinks
Set Flashrechts
Set Flashheck
End If
If V = 1 Then
Reset Flashlinks
Reset Flashrechts
Reset Flashheck
End If
If V = 2 Then
Waitms 30
End If
If V = 3 Then
Waitms 30
End If
...
'Enable Interrupts
Incr V
Start Timer1
Timer1 = 3000
Return
Flashon:
If Flasher = 0 Then
Start Timer1
Flasher = 1
End If
Return
Flashoff:
Stop Timer1
Flasher = 0
Return
Landescheinwerferon:
If Landescheinwerfer = 0 Then
Set Landescheinwerfer
End If
Return
Landescheinwerferoff:
If Landescheinwerfer = 1 Then
Reset Landescheinwerfer
End If
Return
Posilightson:
If Posi = 0 Then
Set Posilightlirot
Set Posilightregruen
Posi = 1
End If
Return
Posilightsoff:
If Posi = 1 Then
Reset Posilightlirot
Reset Posilightregruen
Posi = 0
End If
Return
Ich bekomme beim Print immer nur 0?!?
Ich hoffe dass ich dort einen Fehler drinne Habe
Lesezeichen