package iface // TODO: Use an io.writer instead? type Logger interface { Printf(format string, v ...interface{}) } // Protocol provides an abstract interface to command servos. This exists so // that our abstract Servo type can communicate with actual servos regardless // which protocol version they speak. // // The interface must be the union of all protocol versions, but (so far) they // all have roughly the same instructions, so this isn't a big deal. type Protocol interface { ReadData(ident int, instruction byte) ([]byte, error) // WriteData writes a slice of bytes to the control table of the given servo // ID. WriteData(ident int, instruction byte, data []byte) error }