Coder Social home page Coder Social logo

ricardoquesada / bluepad32-arduino Goto Github PK

View Code? Open in Web Editor NEW
23.0 5.0 4.0 1.38 MB

Bluepad32 for Arduino NINA-W10 boards

Home Page: https://bluepad32.readthedocs.io/en/latest/plat_nina/

License: Other

C 29.19% C++ 70.81%
arduino arduino-library bluepad32 bluetooth gamepad nina nina-w10

bluepad32-arduino's Introduction

Bluepad32 library for Arduino NINA-W10 boards

775177861665521725
logo

Enables gamepad support for all NINA-W10 based boards. In particular these boards:

If you are looking for Arduino running on ESP32 boards, check out this other project:

Supported gamepads

gamepads

With this library you can use any modern Bluetooth gamepad in Arduino. Some of the supported gamepads, but not limited to, are:

  • Sony family: DualSense (PS5), DualShock 4 (PS4), DualShock 3 (PS3)

  • Nintendo family: Switch gamepads, Switch JoyCons, Wii, Wii U

  • Xbox Wireless controller

  • 8BitDo gamepads

  • Android gamepads

  • Stadia controller

  • Windows gamepads

  • and more

How does it work

As mentioned above, only boards with the NINA-W10 (ESP32) co-processor are supported. This is because the project consists of two parts:

  • "Bluepad32 library for Arduino", runs on the main processor: "C"

  • "Bluepad32 firmware", runs on the NINA-W10 co-processor: "B"

how does it work

The gamepads (A), using Bluetooth, connect to the NINA-W10 co-processor (B).

And NINA-W10 (B) sends the gamepad data to the main processor (C). In this case the main processor is the RP2040, but it could be different on other boards. As an example, on the Nano 33 IoT, the main processor is the SAMD 21.

So, in order to use the library you have to flash the "Bluepad32 firmware" on NINA-W10. This is a simple step that needs to be done just once, and can be undone at any time. Info about Bluepad32 firmware is avaiable here:

Use cases

You can use this library to:

  • Create a video game

  • Or control a car / robot

  • Or control LEDs, motor, etc.

  • Or to draw a curtain, open a window, control a fan, etc.

  • etc.

License

Copyright (c) 2021 Ricardo Quesada

SPDX-License-Identifier: Apache 2.0 or LGPL-2.1-or-later

bluepad32-arduino's People

Contributors

mrozbarry avatar ricardoquesada avatar ricardoquesadawork avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

bluepad32-arduino's Issues

Xbox Button not set properly

When connected to a wireless Xbox controller (model 1708), the Xbox system button in the middle is not properly registered.

Debugging steps I performed:

  • Verified all of the other buttons work and register as expected
  • Verify the middle button works when connected to my Xbox
  • Printed out the entire miscButtons bit mask and verified no bits were set when pressing the xbox button (but the select and start bits were properly set when pressing them)

Xbox button is not registered

I have an xbox controller model 1708, ive tried a few of them.
when pressing the xbox center button there is nothing registered under miscButtons. When I try a PS4 or PS5 the PS button DOES register. It only seems to be an xbox 1708.

Im running bluepad33-arduino NINA

further,

How do you call the xbox button direct? or is it on under misc()?
ctrl->miscButtons() or can there be a ctrl->xbox() or ctrl->systembutton()?

Moving PS5 controller away from ESP32 cause unhandled Exception

Hi,
I connected a PS5 controller to ESP32, it is working fine unless I walk away with the PS5 controller from the ESP32. The issue starts to happen when the PS5 controller 6 meters away from the ESP32.

What happened:
I'm using 'Controller' from example. Upload Controller to ESP32.
image

Pair PS5 controller with ESP32
Take PS5 controller about 6 memters away from ESP32, turn myself around make sure my body is between the PS5 controller and the ESP32's direction. Keep walking untill abount 10 meters away from ESP32, the PS5 controller turned off itself.

Below error happened in ESP32

FEX 0 0
FEX 0 0
FEX 7 0
ASSERT_PARAM(0 7), in ld_acl.c at line 1772
Guru Meditation Error: Core 0 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x4008fed4: 00f01d00 00004136 f01d0000
Core 0 register dump:
PC : 0x4008fedb PS : 0x00060f34 A0 : 0x8008573e A1 : 0x3ffc1f50
A2 : 0x00000000 A3 : 0x00000000 A4 : 0x00000007 A5 : 0x3ff9cd42
A6 : 0x000006ec A7 : 0xfffffffb A8 : 0x8000814b A9 : 0x3ffc1ec0
A10 : 0x00000000 A11 : 0x3ffc1ee4 A12 : 0x3ffc1e8f A13 : 0x00000032
A14 : 0x00000000 A15 : 0x3ffc1e95 SAR : 0x00000004 EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000 LBEG : 0x40090f09 LEND : 0x40090f19 LCOUNT : 0xfffffffe

Backtrace: 0x4008fed8:0x3ffc1f50 0x4008573b:0x3ffc1f70 0x400327cb:0x3ffc1f90 0x40087bb5:0x3ffc1fd0 0x40087e89:0x3ffc1ff0 0x4008bde6:0x3ffc2020 0x4008c8af:0x3ffc2040 0x400850be:0x3ffc2060 0x400853dd:0x3ffc2080 0x400853bf:0x00000000 |<-CORRUPTED

ELF file SHA256: 60dedc08e98be6b0

Rebooting...

Support of XBox Elite 2 Controller

Hello,
is the xbox elite 2 controller supported?
It is mentioned in the nina firmware but not in your list of supported controllers.
I'm able to connect it to the "Arduino Nano RP2040 Connect", but no inputs are recognized.

I used the precompiled nina firmware v2.2.1 with Bluepad32 library for Arduino v0.99.1

{ MAKE_CONTROLLER_ID( 0x045e, 0x0b05 ), CONTROLLER_TYPE_XBoxOneController, "Xbox One Elite 2 Controller" }, // { MAKE_CONTROLLER_ID( 0x045e, 0x0b13 ), CONTROLLER_TYPE_XBoxOneController, "Xbox One Series X Controller" }, // Microsoft X-Box One Elite Series X pad (Bluetooth)

Cannot connect to XBOX One S controller after firmware update

Hi, I've started with Bluepad32 few days ago and I was able to successfully use my XBOX One S controllers with Bluepad32, but pairing it was a hit & miss. I've then decided to update the firmware on my XBOX controllers and since then I cannot connect anymore.

Arduino Board: Nano RP2040 Connect
Firmware: Bluepad32 for NINA v2.3.0
XBOX Controller Firmware: Nov 2021(?)

Is this expected to work?

Thanks

Incorrect Bluetooth address when multiple devices connected

Prerequisites:

  • No device connected.

Stimuli:

  • Connect one device with BT address X.
  • Connect another device with BT address Y.

Response:

  • When onConnectedGamepad is called for device X, the BT address for device X is used. OK
  • When onConnectedGamepad is called for device Y, the BT address for device X is used. NOK

Expected response:

  • The correct BT address is seen in onConnectedGamepad so that functionality can be built towards a specific device.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.