Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kshoji/pxt-bluetooth-gamepad
BLE HID Gamepad module for micro:bit
https://github.com/kshoji/pxt-bluetooth-gamepad
ble gamepad microbit pxt
Last synced: 3 months ago
JSON representation
BLE HID Gamepad module for micro:bit
- Host: GitHub
- URL: https://github.com/kshoji/pxt-bluetooth-gamepad
- Owner: kshoji
- License: mit
- Created: 2018-02-20T10:46:37.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-03-01T10:50:40.000Z (over 6 years ago)
- Last Synced: 2024-01-26T07:03:56.520Z (6 months ago)
- Topics: ble, gamepad, microbit, pxt
- Language: C++
- Homepage:
- Size: 46.9 KB
- Stars: 27
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-microbit - Bluetooth Gamepad - MakeCode extension for BLE HID Gamepad module for micro:bit V1. (👩💻 Programming / 🗿 JavaScript and MakeCode)
README
# bluetooth-gamepad
This PXT package allows the micro:bit to act as a Gamepad peripheral.
## Usage
Place a ``||bluetooth start gamepad service||`` block in your program to enable Bluetooth LE Gamepad.
With this block, the `micro:bit` starts advertise BLE packets as a Gamepad peripheral.```blocks
bluetooth.startGamepadService();
```For example, hold left gamepad button :
```blocks
bluetooth.setGamepadButton(GamepadButton.GAMEPAD_BUTTON_LEFT, ButtonState.BUTTON_DOWN);
```## About test script (test.ts)
The micro:bit's memory(RAM) size is too small to run the test script.
To build & run the test script(test.ts), edit `pxt.json` file, and activate `"yotta" : "config"` part of the configuration.This hack makes `BLE GATT table` smaller, and removes unnecessary BLE services(DFU, Event, and Device Information Service).
## Supported Platforms
Currently, tested with `micro:bit` and `Android` host only.
Mac OS X can connect with `micro:bit`, but it can't receive Gamepad messages.## Supported targets
* for PXT/microbit
(The metadata above is needed for package search.)
## License
MIT
```package
bluetooth
bluetooth-gamepad=github:kshoji/pxt-bluetooth-gamepad
```