• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
  • Created over 4 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reverse Engineering of LEGO Mario, Luigi, and Peach

Reverse Engineering of LEGO Mario, Luigi, and Peach

Overview

LEGO Mario as BLE Device

LEGO Mario is a BLE device which supports LEGO Wireless Protocol. It has six input/output devices as follows:

  • Port 0: 0x47 Accelerometer, Gesture?
  • Port 1: 0x49 Color Barcode, RGB Color
  • Port 2: 0x4a Pants
  • Port 3: 0x46 Events, Debug, and something
  • Port 4: 0x55 ???
  • Port 6: 0x14 Voltage

Color Barcode

Each color barcode is drawn with five out of nine (eight?) colors. The first two lines are always green and red as header part. The other three lines are data part. The data value can be from 0x01 to 0xd2. That means there are 0xd2 = 210 (= 7 * 6 * 5) patterns.

Pants

Each pants has a unique 6 bit code. The pants sensor at the bottom of LEGO Mario can detect it physically.

  • e.g. The normal Mario's pants is 100001 = 0x21.
  • See details

LEGO Wireless Protocol

Manufacturer Data

Example: 97 03 00 43 03 ff ff 00

  • System Type and Device Number:
    • 0x43 LEGO System - Mario
    • 0x44 LEGO System - Luigi
    • 0x45 LEGO System - Peach
  • Device Capabilities:
    • 0x03 Supports Central Role, Supports Peripheral Role

Hub Properties

  • 0x03 FW Version: 5.0.00.0000
  • 0x12 Volume: 0 - 100

Port Information [0x43]

Port ID IO Type Capabilities Input Modes Output Modes Possible Mode Combination
0 0x47 Logical Combinable, Input 0, 1 - [0, 1]
1 0x49 Logical Combinable, Input 0, 1 - [0, 1]
2 0x4a Input 0 - -
3 0x46 Input 0, 1, 2, 3 - -
4 0x55 Input, Output 0, 1 0, 1 -

Port Mode Information [0x44]

Port ID Mode Name RAW Range PCT Range SI Range Symbol Mapping Value Format
0 0 RAW 0 - 100 0 - 100 0 - 100 cnt Supports NULL, Discrete 3 * 8 bit
1 GEST 0 - 10 0 - 100 0 - 10 raw Supports NULL, Discrete 2 * 16 bit
1 0 TAG 0 - 10 0 - 100 0 - 10 idx Supports NULL, Discrete 2 * 16 bit
1 RGB 0 - 10 0 - 100 0 - 10 raw Supports NULL, Discrete 3 * 8 bit
2 0 PANT 0 - 63 0 - 100 0 - 63 idx Supports NULL, Discrete 1 * 8 bit
3 0 CHAL 0 - 65535 0 - 100 0 - 65535 na Supports NULL, Discrete 2 * 16 bit
1 VERS 0 - 255 0 - 100 0 - 255 na Supports NULL, Discrete 4 * 32 bit
2 EVENTS 0 - 65535 0 - 100 0 - 65535 na Supports NULL, Discrete 2 * 16 bit
3 DEBUG 0 - 65535 0 - 100 0 - 65535 na Supports NULL, Discrete 4 * 32 bit
4 0 FS Code 0 - 65535 0 - 100 0 - 65535 na Supports NULL, Discrete 1 * 16 bit
1 Events 0 - 65535 0 - 100 0 - 65535 na Supports NULL, Discrete 2 * 16 bit

More Repositories

1

JSONRPCKit

A type-safe JSON-RPC 2.0 library purely written in Swift
Swift
177
star
2

BoostRemote

Remote Control iOS app for LEGO® BOOST
Swift
66
star
3

scratch-lego-bluetooth-extensions

Scratch 3.0 extensions for LEGO Bluetooth devices.
JavaScript
48
star
4

BoostBLEKit

Bluetooth LE protocols for LEGO® Boost in Swift
Swift
25
star
5

Scrub

Web browser app for Scratch 3.0 and Bluetooth devices
Swift
22
star
6

PresentationControllerSample

a sample of UIPresentationController
Objective-C
18
star
7

ReactKit-APIKit-Himotoki-sample

Incremental search sample created using ReactKit, APIKit and Himotoki
Swift
15
star
8

TwitterLikeProfileViewSample

a sample of Twitter-like profile view
Objective-C
15
star
9

LEGO-Hub2Hub-Communication-Hacks

LEGO MINDSTORMS Robot Inventor's Hub to Hub Communication Hacks
Python
14
star
10

Minesweeper360

Minesweeper 360 for visionOS
Swift
14
star
11

ImagePipDemo

A demonstration of Picture In Picture with generated images
Swift
13
star
12

RxTableViewSample

Reactive UITableView sample created using RxSwift and RxCocoa
Swift
11
star
13

AmiiboReader

Reading data from amiibo by using Core NFC
Swift
9
star
14

PowerFunctionPlaygroundBook

Swift Playground Book for LEGO WeDo 2.0, BOOST, and Powered Up
Swift
7
star
15

DicSample

a sample of extracting HTML string from UIReferenceLibraryViewController
7
star
16

BoostBLEKit-Showcase

Showcase of BoostBLEKit
Swift
6
star
17

HelloBeacon

iBeacon で入退室のログをとってみるテスト
Objective-C
6
star
18

SpikePlaygrounds-Swift

LEGO Education SPIKE Prime Playgrounds in Swift
Swift
5
star
19

MicrobitScratchKit

micro:bit simulation library to communicate with Scratch 3.0
Swift
4
star
20

LWPKit

Swift Package for LEGO Wireless Protocol
Swift
4
star
21

WeDoSimulator

WeDo 2.0 BLE Simulator
Swift
3
star
22

M5Stack-LEGO-BLE-Remote

LEGO BLE Remote app for M5Stack
C++
2
star
23

Joy-Con-Programming-Samples

Joy-Con programming samples in Swift
Swift
2
star
24

HBFavAction

unofficial Action extension for HBFav
Swift
2
star
25

MIDI-Servo-Control

MIDIメッセージでサーボを制御できるUSB MIDIデバイスと操作アプリ
Swift
2
star
26

DummyPlaygroundBluetooth

Dummy framework of PlaygroundBluetooth framework
Swift
2
star
27

SimpleCoreMIDIApps

Simple Core MIDI Apps
Swift
1
star
28

ScratchBrowser

Web Browser for Scratch 3.0 and BLE devices
Swift
1
star
29

SwiftWasm-WebMIDIKeyboard

Web MIDI API Keyboard built with SwiftWasm
Swift
1
star
30

LEGO-Remote-Playgrounds

Swift Playgrounds 4で動くレゴ用Bluetoothリモコン
Swift
1
star
31

lumines-js

lumines.js is a JavaScript library for programming about LUMINES
JavaScript
1
star
32

BLEDump

Swift
1
star
33

DiskSpaceEater

Swift
1
star
34

MineSweeperVR

C#
1
star
35

ScratchExtensionTest

1
star