Skip to content

Stick data decoding? #155

@WindowStations

Description

@WindowStations

I'm accessing JoyCons with Visual Basic 6 and I've run into a mess trying to decode the thumbstick data. I think I got it manually by observing the numbers that change faster than others, to figure out their place value. I was not able to convert the sample here in the Bluetooth section.

I'm using the following process to try and decode the stick data.

        Dim x As String
        Dim y As String
       'left joycon
         x = VBA.Mid(bv, 16, 1) & VBA.Mid(bv, 13, 1) & VBA.Mid(bv, 14, 1) 
         y = VBA.Mid(bv, 17, 1) & VBA.Mid(bv, 18, 1) & VBA.Mid(bv, 15, 1) 

        'right joycon
         x = VBA.Mid(bv, 22, 1) & VBA.Mid(bv, 19, 1) & VBA.Mid(bv, 21, 1)
         y = VBA.Mid(bv, 23, 1) & VBA.Mid(bv, 24, 1) & VBA.Mid(bv, 20, 1)

Original code:

uint8_t *data = packet + (left ? 4 : 8);
uint16_t stick_horizontal = data[0] | (data[1] << 8);
uint16_t stick_vertical = data[2] | (data[3] << 8);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions