Suggestions (#3) - wminput LED support… (#34) - Message List
I noticed the patches for LED support for wminput. I was wondering how easy it would be to add different LED functions when a wiimote is connected? I was going to play around with it this weekend if dsmith wasn't allready integrating the patches.
I was thinking that there could be a command line option (--led) to set what the LED's on the wiimote did. I think it would be handy if they acted as a power meter. Other choices could include having all 4 blink, or (when multiple connected wiimote support is implemented) have them show the wiimote "number" counting up in binary (similar to how the wii does it).
To simplify things there could just be one default function for the LED's and no command line option (there are already tickets with patches that will do some of the above functions). If this is the case I vote for the LED's acting as a battery level indicator.
I've seen the patches from sascha.scholz, but haven't taken the time to evaluate them. You seem to be interested in contributing (anyone who takes on the least glamorous job possible of command-line reworking must be) - see what you think of them, and if they do what you're talking about. If not, add the functionality you're looking for.
I think this is a job for the configuration files rather than command-line, however. Another idea (and this leads into another topic that needs to be addressed eventually - buttons that trigger wminput actions rather than uinput events) is to trigger a momentary power meter (or other LED action) with a button.
I must apologize about the lack of comments in wminput (and throughout). I have a bad habit of commenting decently during first runs, then deleting old comments rather than updating them as the code is reworked. I fear this will make libcwiid and wminput very difficult to work with - I'll begin adding decent comments.
Git has spoiled me, and I have no desire to learn the intricacies of merging with Subversion unless it becomes necessary due to multiple contributers. When [sources:/branches/dev] is ready, I'm just going to copy it over rather than merging, so use that as your base.dsmith06/01/07 14:47:42 (6 years ago)
I'm planning on hacking away at this all weekend. I have a few things I want to try out and play with. I'll try and have something working by Monday.
I think the other tickets for with patches should be closed and everything done under one wminput LED support ticket, just so we don't have 20 different yet same tickets floating around.
Also, just so you know, I'm not too good in C. I've only done some simple things with it in the past (very basic openGL stuff). I know C++ pretty good and like OO programming, but I haven't done too much low level programming before. I thought I would start with something small (the command line stuff) and work my way up. I've looked at the code enough by now that I know what's going on, so we'll see how things go. I can definitely get what I want done with the LED support, I just hope that I can do it well enough so it doesn't have to be completely rewritten.
Just thought I would warn you ;)nickishappy06/07/07 02:14:26 (6 years ago)
Good idea - I'll go through the tickets over the weekend.
The best way to get good at C is to do it. Code to the best of your ability, and we'll go from there.
Thanks, and safe hacking.dsmith06/08/07 11:38:24 (6 years ago)
Well, hacking away all weekend turned into to dealing with problems with my band and visiting with old friends. I did get a battery meter working, but it's not that great. I started thinking about how having different LED functions would be easier. I was thinking that an LED plugin would be the best option. This way you could define what the LED's do in config files.
Let me know what you think. I'm going to play around with this for a bit and I'll submit some patches when I get something decent working.
I was also wondering if handling button presses could be done through a plugin. This might be a good way to handle button events within wminput first, and also allow buttons to be linked to scripts (which I would still like as a feature). I have no idea how to do this, but if you point me in the right direction I can see what I can do.
One more thing - I was wondering if you want to meet up in an IRC chat sometime, or possibly set up a chatroom for cwiid.nickishappy06/12/07 03:36:30 (6 years ago)
LED plugin sounds good - you should be able to emulate most or all of the functionality of a built in feature with plugin parameters. Just register to receive button presses in the plugin's init function. For now, hardcode the script names, but we could add a string parameter type down the road.
IRC chat - sure, although it may be this weekend before I have time. I've never been a big IRC user, so I'll let you set up the room or whatever, and tell me where to go. IM works as well, preferably AIM.dsmith06/13/07 17:19:12 (6 years ago)
I finally got around to playing with creating an led plugin. I hope I'll have something in the next week for you to try out.nickishappy08/24/07 08:38:56 (6 years ago)
I got a working version of the led plugin done, and attached my edited trunk to a new ticket. I tested the battery meter functionality a bit with different batteries, and it all seems to work pretty well. Let me know what you think.
Also, there has to be a better way to submit changes like this. I would just do a patch, but I also added new directories within the trunk. It would only take slight modification of this plugin to implement a rumble plugin, and I might go ahead and make that one next. I need to figure a few more things out before I get a scirpt_launch plugin going, but it's still something I think I'll do. Is there a way that you prefer I submit these? Maybe i can have an svn branch?
Sorry again this took me so long.nickishappy08/25/07 11:40:29 (6 years ago)