Get the servo position

Reads the current position from the OpenServo. You can read the position at the time of reading the register, or get the position that the servo has been destined.

Reading the OpenServo requires two I2C transactions. The first sets the register to be read, and the second is the read transaction.

Get current position

16bit precision

0x08

POSITION_HI

Read Only

Servo position high byte

0x09

POSITION_LO

Read Only

Servo position low byte

Read the current position from the OpenServo. This is the exact position of the OpenServo at the time of reading.

In order to get the current position you must get a 16 bit registers. Assuming device = 0x10

Get the position:

POSITION_HI = 0x08 POSITION_LO = 0x09
send  [device POSITION_HI]
read  [device {max_hi} {max_lo}]
send [0x10 0x08]
read [0x10 {pos_hi} {pos_lo}]

Get destined position

16bit precision

0x10

SEEK_HI

Read/Write

Seek position high byte

0x11

SEEK_LO

Read/Write

Seek position low byte

Reads the servo destination position.

Get the seek position:

SEEK_HI = 0x10 SEEK_LO = 0x11
send  [device SEEK_HI]
read  [device {seek_hi} {seek_lo}]
send [0x10 0x10]
read [0x10 {seek_hi} {seek_lo}]