Giter VIP home page Giter VIP logo

Comments (8)

sam0x17 avatar sam0x17 commented on September 25, 2024

Yes, this is a low priority to-do item. Pull requests are welcome if anyone already knows how to do this.

from xjoy.

takashi1kun avatar takashi1kun commented on September 25, 2024

Yes this could be great, is quite anoying to see the leds cycling, you may take a look to this https://github.com/mfosse/JoyCon-Driver that thing is a similar thing to this and is capable of stopping the cycling and set the leds to one position.

from xjoy.

sam0x17 avatar sam0x17 commented on September 25, 2024

Yes, I've looked extensively through that code, though I don't quite understand the initialization sequence, but anyone is free to submit a pull request ;)

from xjoy.

TideSinger avatar TideSinger commented on September 25, 2024

printf("setting LEDs...\n"); for (int r = 0; r < 5; ++r) { for (int i = 0; i < joycons.size(); ++i) { Joycon *jc = &joycons[i]; // Player LED Enable memset(buf, 0x00, 0x40); if (i == 0) { buf[0] = 0x0 | 0x0 | 0x0 | 0x1; // solid 1 } if (i == 1) { if (settings.combineJoyCons) { buf[0] = 0x0 | 0x0 | 0x0 | 0x1; // solid 1 } else if (!settings.combineJoyCons) { buf[0] = 0x0 | 0x0 | 0x2 | 0x0; // solid 2 } } //buf[0] = 0x80 | 0x40 | 0x2 | 0x1; // Flash top two, solid bottom two //buf[0] = 0x8 | 0x4 | 0x2 | 0x1; // All solid //buf[0] = 0x80 | 0x40 | 0x20 | 0x10; // All flashing //buf[0] = 0x80 | 0x00 | 0x20 | 0x10; // All flashing except 3rd light (off) jc->send_subcommand(0x01, 0x30, buf, 1); }
This appears to be the code associated with it, it should be simple to set the lights based off of this code, just use the mem codes and send them to the controllers

from xjoy.

PeterHindes avatar PeterHindes commented on September 25, 2024

printf("setting LEDs...\n"); for (int r = 0; r < 5; ++r) { for (int i = 0; i < joycons.size(); ++i) { Joycon *jc = &joycons[i]; // Player LED Enable memset(buf, 0x00, 0x40); if (i == 0) { buf[0] = 0x0 | 0x0 | 0x0 | 0x1; // solid 1 } if (i == 1) { if (settings.combineJoyCons) { buf[0] = 0x0 | 0x0 | 0x0 | 0x1; // solid 1 } else if (!settings.combineJoyCons) { buf[0] = 0x0 | 0x0 | 0x2 | 0x0; // solid 2 } } //buf[0] = 0x80 | 0x40 | 0x2 | 0x1; // Flash top two, solid bottom two //buf[0] = 0x8 | 0x4 | 0x2 | 0x1; // All solid //buf[0] = 0x80 | 0x40 | 0x20 | 0x10; // All flashing //buf[0] = 0x80 | 0x00 | 0x20 | 0x10; // All flashing except 3rd light (off) jc->send_subcommand(0x01, 0x30, buf, 1); }
This appears to be the code associated with it, it should be simple to set the lights based off of this code, just use the mem codes and send them to the controllers

make a pull request?

from xjoy.

wormyrocks avatar wormyrocks commented on September 25, 2024

Hi, this is covered in my pull request, so building the new version from source should set up the LEDs.

from xjoy.

sam0x17 avatar sam0x17 commented on September 25, 2024

yes, I plan to include that in the next release -- was hoping TOML support would also be done in time, but if another week goes by I'll just cut a release now

from xjoy.

sam0x17 avatar sam0x17 commented on September 25, 2024

here is prettified format of above code if anyone needs it:

printf("setting LEDs...\n");
for (int r = 0; r < 5; ++r) {
  for (int i = 0; i < joycons.size(); ++i) {
    Joycon * jc = & joycons[i];
    // Player LED Enable memset(buf, 0x00, 0x40);
    if (i == 0) {
      buf[0] = 0x0 | 0x0 | 0x0 | 0x1;
      // solid 1 } if (i == 1) { if (settings.combineJoyCons) { buf[0] = 0x0 | 0x0 | 0x0 | 0x1;
      // solid 1 } else if (!settings.combineJoyCons) { buf[0] = 0x0 | 0x0 | 0x2 | 0x0;
      // solid 2 } } //buf[0] = 0x80 | 0x40 | 0x2 | 0x1;
      // Flash top two, solid bottom two //buf[0] = 0x8 | 0x4 | 0x2 | 0x1;
      // All solid //buf[0] = 0x80 | 0x40 | 0x20 | 0x10;
      // All flashing //buf[0] = 0x80 | 0x00 | 0x20 | 0x10;
      // All flashing except 3rd light (off) jc->send_subcommand(0x01, 0x30, buf, 1);
    }
  }
}

from xjoy.

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.