'++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ '+ + '+ Eingang --> Portd.3 + '+ Servo1 --> Portb.0 + '+ Servo1 --> Portb.2 + '+ Feuer1 --> Portb.3 + '+ Feuer2 --> Portb.4 + '+ + '+ + '+ Werte fü die Servoansteuerung + '+ Oben PulsIn 240 --> Anschlag 95 + '+ Unten PulsIn 163 --> Anschlag 180 + '+ Links PulsIn 296 --> Anschlag 78 + '+ Rechts PulsIn 255 --> Anschlag 287 + '+ Feuer1 Pulsin 224 + '+ Feuer2 Pulsin 313 + '+ + '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ $crystal = 4000000 $baud = 9600 Dim Check As Long Dim Puls As Word Dim Puls2 As Word Dim Horwert As Word Dim Vertwert As Word Dim A As Word Dim Flag As Byte Config Portd = Input Config Portb = Output Portb = 0 Config Timer0 = Timer , Prescale = 256 On Timer0 Timer0_isr Enable Timer0 Enable Interrupts Print "Testtest"; Print Chr(13); Horwert = 167 Vertwert = 183 Start: '******************** Impulsmessung ********************* Puls = 0 While Pind.3 = 0 Wend While Pind.3 = 1 Puls = Puls + 1 Wend '******************** Impulsauswertung ****************** Check = Puls - 240 If Check < 2 Then If Check > -2 Then If Horwert > 95 Then Horwert = Horwert - 3 End If End If End If '******************************************************** Check = Puls - 163 If Check < 2 Then If Check > -2 Then If Horwert < 180 Then Horwert = Horwert + 3 End If End If End If '******************************************************** Check = Puls - 296 If Check < 2 Then If Check > -2 Then If Vertwert > 78 Then Vertwert = Vertwert - 4 End If End If End If '******************************************************** Check = Puls - 255 If Check < 2 Then If Check > -2 Then If Vertwert < 287 Then Vertwert = Vertwert + 4 End If End If End If '******************************************************** Check = Puls - 224 If Check < 2 Then If Check > -2 Then Puls = 0 While Pind.3 = 0 Wend While Pind.3 = 1 Puls = Puls + 1 Wend Check = Puls - 224 Puls = 0 If Check < 2 Then If Check > -2 Then Portb.3 = 1 Waitms 10 Portb.3 = 0 End If End If End If End If '********************************************************** Check = Puls - 313 If Check < 2 Then If Check > -2 Then Puls = 0 While Pind.3 = 0 Wend While Pind.3 = 1 Puls = Puls + 1 Wend Check = Puls - 313 Puls = 0 If Check < 2 Then If Check > -2 Then Portb.4 = 1 Waitms 10 Portb.4 = 0 End If End If End If End If 'Print Wert; 'Print Chr(13); Goto Start Timer0_isr: Portb.0 = 1 For A = 1 To Horwert Next Portb.0 = 0 Portb.2 = 1 For A = 1 To Vertwert Next Portb.2 = 0 Return