Skip to content

Commit

Permalink
Renamed project
Browse files Browse the repository at this point in the history
  • Loading branch information
unic8s committed Dec 7, 2024
1 parent dcdac58 commit cdc2fec
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 50 deletions.
45 changes: 2 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,2 @@
# HD2 Macropad - BT2USB Bridge

This is the software for a Raspberry Pi Pico W to work as a Bluetooth-to-USB bridge for the [HD2 Macropad](https://github.com/unic8s/hd2_macropad).
You connect the Raspberry Pi Pico W via USB cable to your PS5™ and it automatically connects the [HD2 Macropad](https://github.com/unic8s/hd2_macropad) via Bluetooth.

> HELLDIVERS and PS5 a registered trademarks of SONY INTERACTIVE ENTERTAINMENT LLC.
## Prerequesites
- The controller [Raspberry Pi Pico W](https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html#raspberry-pi-pico-w-and-pico-wh)
- Micro USB data cable to communicate with a PC for flashing the firmware once.

## Installation

The firmware is already pre-built available in our release section. Just go ahead and download your prefered version (we surely recommend to use the lastest one).
Please follow the described steps.

### Firmware
1. Download the [lastest BIN file](https://github.com/unic8s/bt2usb_keyboard/releases/latest/download/bt2usb_keyboard.UF2) or your prefered [release](https://github.com/unic8s/bt2usb_keyboard/releases)
2. Press and hold the BOOT button on the [Raspberry Pi Pico W](https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html#raspberry-pi-pico-w-and-pico-wh) while connecting it to PC via Micro USB data cable
3. A file explorer window will open and a (virtual) drive. Copy the downloaded UF2 firwmare file into that drive.
4. After finish copying the file just disconnect the [Raspberry Pi Pico W](https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html#raspberry-pi-pico-w-and-pico-wh) from the PC.

## Setup

In general there is no specific further configuration needed.
You just have to connect the [Raspberry Pi Pico W](https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html#raspberry-pi-pico-w-and-pico-wh) with a Micro USB cable to the PS5™.

After successful pairing with the [HD2 Macropad](https://github.com/unic8s/hd2_macropad) the device LED will light up.

## Software - for developers

- IDE: [Arduino]([https://code.visualstudio.com/](https://www.arduino.cc/en/software)) + [Pi Pico Core]([https://platformio.org/](https://github.com/earlephilhower/arduino-pico))
- Board: [Raspberry Pi Pico W](https://www.raspberrypi.com/documentation/microcontrollers/pico-series.html#raspberry-pi-pico-w-and-pico-wh)
- Framework: Arduino
- Libraries & functions
- BluetoothHCI for Bluetooth scanning
- BluetoothHIDMaster for BLE keyboard connection
- Keyboard for USB HID connection

## Disclaimer and copyright
> This is a private opensource project and is not associated in any kind with SONY INTERACTIVE ENTERTAINMENT LLC.
> SONY INTERACTIVE ENTERTAINMENT LLC is not responsible for any function and content that is related to this project.
> Related assets in this project are either produced by us and free to use or respectively published by the owners mentioned here.
# bt2usb_keyboard
Bluetooth to USB keyboard proxy
22 changes: 15 additions & 7 deletions bt2usb_keyboard.ino → bt2usb_bridge.ino
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
#include <BluetoothHCI.h>
#include <BluetoothHIDMaster.h>
#include "Keyboard.h"
#include "WiFiManager.h"
//#include "WiFiManager.h"


#define BT_USB_OFFSET 61
#define KEY_ASCII_OFFET 13

#define STATION_NAME "BT2USB Keyboard"
#define DEVICE_NAME "HD2 Macropad"
#define SCAN_NAME "HD2 Macropad"
#define DEVICE_NAME "BT2USB Keyoard"
//#define WIFI_PASSPHRASE "superearth"


BluetoothHIDMaster hid;
BluetoothHCI hci;


WiFiManager wm(STATION_NAME, "superearth");
//WiFiManager captivePortal(DEVICE_NAME, WIFI_PASSPHRASE);


uint8_t modifierMap[128] = {};
Expand Down Expand Up @@ -47,8 +48,6 @@ void kb(void *cbdata, int key) {
}

void setup() {
bool success = wm.autoConnect();

pinMode(LED_BUILTIN, OUTPUT);

setupModifierMap();
Expand Down Expand Up @@ -100,7 +99,7 @@ void connectMacropad(){

String deviceName = e.name();

if(deviceName == DEVICE_NAME){
if(deviceName == SCAN_NAME){
bleFound = true;
bleRescan = false;

Expand Down Expand Up @@ -158,3 +157,12 @@ void loop() {
yield();
delay(1);
}

/*void setup1(){
bool success = captivePortal.autoConnect();
}
void loop1(){
yield();
delay(1);
}*/

0 comments on commit cdc2fec

Please sign in to comment.