Hallo,

ich habe ein folgendes Problem. Ich kann mein Servo jetzt über Bascom ansteuern, kriege es aber nicht hin, den Servo über Poti anzusteuern.
Könnt ihr einen kurzen Programmcode schreiben?

So sieht mein Programm ohne Poti Ansteuerung aus.

Vielen Dank

'******** Compailereinstellung Anfang ***
$crystal = 12000000
$regfile = "m48def.dat"
$baud = 9600
'******* Compailereinstellung ende ******
'******** Config Ports Anfang ***********
Config Servos = 1 , Servo1 = Portb.1 , Reload = 10
Config Pinb.1 = Output
Config Portc = Input
Config Portd = Output
Enable Interrupts
'******** Config Ports Ende *************
'******** Deklaration Anfang ************
Dim Position As Byte
Dim Zaehler As Byte

'******** Dekleration Ende **************
'******** Initialisierung Anfang ********
Zaehler = 10
Position = 105
'******** Initialisierung Ende **********
'******** Hauptprogramm Anfang **********
Servo(1) = Position

Do
If Pinc.1 = 0 Then
Waitms 100
Position = Position + Zaehler

If Position = 165 Then
Position = 105
End If

Servo(1) = Position
Portd.0 = 1
Waitms 200
Portd.0 = 0

Elseif Pinc.2 = 0 Then
Waitms 100
Position = Position - Zaehler

If Position = 45 Then
Position = 105
End If

Servo(1) = Position
Portd.0 = 1
Waitms 200
Portd.0 = 0

End If
Loop

End