Git Product home page Git Product logo

Comments (7)

ricardoquesada avatar ricardoquesada commented on May 31, 2024 2

yes, sure. Some controllers are reporting the battery status, so it shouldn't be that difficult to add it.

In particular, what controller are you using? Just to double check that it reports the battery status

from bluepad32.

ste2425 avatar ste2425 commented on May 31, 2024

Forgot to add im using the Arduino nano 33 IOT platform. Just incase this functionality exists on another platform.

from bluepad32.

ste2425 avatar ste2425 commented on May 31, 2024

brilliant thanks.

I primarily use a PS4 pad but also been testing an Xbox One S and Wii controller.

Understandable not all controllers may report a battery status.

from bluepad32.

ricardoquesada avatar ricardoquesada commented on May 31, 2024

This feature is going to be included as part of get_controller_data (instead of get_gamepad_data)... and controller will include a union of gampead, mouse, balance_board... and the battery will be part of that.

from bluepad32.

ste2425 avatar ste2425 commented on May 31, 2024

@ricardoquesada Sorry forgot to reply to this after the XMas holidays.

Yup that plan sounds good. Noticed your recent commits on this work, if i was to pull the BP32 firmware from a latest develop build it would have this functionality in right?

Is the Arduino side of the fence implemented to query that data from the Nina chip?

If so i will pull down and have a play, thanks.

from bluepad32.

ricardoquesada avatar ricardoquesada commented on May 31, 2024

the NINA part is missing... Planning to work on that this week / weekend.

I split the data in a controller union

  • gamepad data
  • mouse data
  • balance data
  • (...open for other type of controllers in the future)

And the controller properties includes the battery.
The old API will still work... you should be able to do get_gamepad_data.
But the new one is more flexible...

Pending: Add the new Controller API on NINA and also on Arduino (non-NINA)... test it... and release it.

from bluepad32.

ricardoquesada avatar ricardoquesada commented on May 31, 2024

Fixed.

Please test it with:

  • bluepad32-arduino v1.2.0
  • bluepad32 FW v3.6.0-rc0

There is a new method called battery():
0 = Unk
1 = Empty
255 = full

There is a new API to handle Controllers... which is Controller.h ...
And Gamepad is just an alias to Controller... so you don't have to change anything... but you might want to do some renames in the future to keep it cleaner.

from bluepad32.

Related Issues (20)

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.