SukkoPera / PsxNewLib

Playstation controller interface library for Arduino
GNU General Public License v3.0
130 stars 28 forks source link

Adding rumble feature to PsxNewLib #10

Closed katemonster33 closed 3 years ago

katemonster33 commented 3 years ago

Added functions for enabling/disabling rumble feature, and activating motors. This was pretty off-the-cuff so if you're able to proof it a bit that would be great. If you have any questions about how the rumble message flow works, let me know!

SukkoPera commented 3 years ago

Thanks a lot for your contribution! I cannot test it at the moment, but it looks fine to me.

May I just ask you to also add an example sketch that showcases this feature? Something like rumble that gets stronger or weaker as you press buttons or whatever you like :).

That will also make it easy to test the feature as the library evolves. This is important as I have huuuge changes in the devel branch which will make it to mainline one not too far day.

katemonster33 commented 3 years ago

Thanks a lot for your contribution! I cannot test it at the moment, but it looks fine to me.

No problem! I was working on a PSX/PS2 library for Arduino several years ago, but found your code, so I knew what needed to be done already. I am seeing issues with rumble though, where the controller will vibrate for a millisecond, then it appears to lose power. I will do some digging to see if I can resolve it before I move forward with merging this code.

May I just ask you to also add an example sketch that showcases this feature? Something like rumble that gets stronger or weaker as you press buttons or whatever you like :).

Good idea, I didn't think of that. I will work on that.

That will also make it easy to test the feature as the library evolves. This is important as I have huuuge changes in the devel branch which will make it to mainline one not too far day.

Oh! I missed this branch when implementing this feature. I see you are working on the ACK pin integration - I was going to do that next. Is that working in the devel branch?

SukkoPera commented 3 years ago

Yes it is, but work is still in progress (fixed a bug with older controllers right last night!). That branch has undergone massive changes wrt master and I haven't fixed/ported everything yet. The good news is that the API changes on the user's side are minimal.

I plan to still make a couple of new releases with the master branch, so you can work on that for the rumble, we'll port the code later.

katemonster33 commented 3 years ago

I took a stab at an example sketch. It may be a bit heavy for an example. What do you think?