LEGO / lego-ble-wireless-protocol-docs

This repository contains information about LEGO Hubs (name, battery level, etc.) and to interact with any sensors and motors connected to it.
https://lego.github.io/lego-ble-wireless-protocol-docs
MIT License
334 stars 43 forks source link

Explain usage of Encoder Preset: {0x0b,0x00,0x81,0x01,0x11,0x51,0x02,0x5a,0x00,0x00,0x00}; #17

Open marcrupprath opened 4 years ago

marcrupprath commented 4 years ago

Hello,

When using App of Rally Car there is a calibration sequence with

Subcommand :0x51,0x02 Data:bytes ,0x00,0x00,0x00,0x00 and Subcommand: 0x51,0x02 Databytes : ,0x5a,0x00,0x00,0x00

Can you explain in detail how it works and how to choose values for Data ?

Thanks in advance

Marc

justxi commented 3 years ago

Hi, the last four byte seem to be the absolute position, at least it works with the external motor from boost.

EDIT: It is documented in chapter 6.1 "(P)RESET ENCODER Command encoded as WriteDirectModeData (Cmd 0x81, Sub Cmd 0x51)": https://lego.github.io/lego-ble-wireless-protocol-docs/index.html#encoding-of-writedirectmodedata-0x81-0x51