bei servo2 wär das ja:
Code:
Do
Posit = 2200 ' position (1000 - 2000)
Lsb = Low(posit)
Msb = High(posit)
I2cstart
I2cwbyte Servo_adr ' serv CTRL I2C Addr
I2cwbyte 3 ' servo nr
I2cwbyte 0 ' speed
I2cwbyte Lsb ' lsb of position
I2cwbyte Msb ' Msb of position
I2cstop
Waitms 3000
Posit = 800 ' position (1000 - 2000)
Lsb = Low(posit)
Msb = High(posit)
I2cstart
I2cwbyte Servo_adr ' serv CTRL I2C Addr
I2cwbyte 3 ' servo nr
I2cwbyte 0 ' speed
I2cwbyte Lsb ' lsb of position
I2cwbyte Msb ' Msb of position
I2cstop
Waitms 3000
Loop
bei 3:
Do
Posit = 2200 ' position (1000 - 2000)
Lsb = Low(posit)
Msb = High(posit)
I2cstart
I2cwbyte Servo_adr ' serv CTRL I2C Addr
I2cwbyte 6 ' servo nr
I2cwbyte 0 ' speed
I2cwbyte Lsb ' lsb of position
I2cwbyte Msb ' Msb of position
I2cstop
Waitms 3000
Posit = 800 ' position (1000 - 2000)
Lsb = Low(posit)
Msb = High(posit)
I2cstart
I2cwbyte Servo_adr ' serv CTRL I2C Addr
I2cwbyte 6 ' servo nr
I2cwbyte 0 ' speed
I2cwbyte Lsb ' lsb of position
I2cwbyte Msb ' Msb of position
I2cstop
Waitms 3000
Loop
Lesezeichen