Diese Rechnungen in der Klammer chr(curr_pos - servo_counter) mag er nicht. das mußt du vorher in einer Variablen ausrechnen.
ABER
mach es nicht so kompliziert:
Je nachdem schritt + oder - ist, geht's rauf oder runterCode:dim curr_pos as byte curr_pos = 127 ' mittelposition am anfang hauptschleife ... Sub Rnb_servo(byval Servonummer As Byte , Byval Go_to_pos As Byte) local schritt as integer if curr_pos < go_to_pos then schritt = 1 else schritt = -1 end if For curr_pos = Curr_pos To Go_to_pos step schritt Print "#s" ; Chr(servonummer) ; Chr(curr_pos) Waitms 10 Next
Lesezeichen