morcibacsi/PSASteeringWheelAdapter

Changes proposal for Pioneer MPC41xxx control

Closed this issue · 2 comments

Hi,

I had a similar project for driving a Pioneer HU using an Arduino and a MCP41100, except I wasn't doing anything related to the VAN-bus since it seemed too obscure for me at the time I wrote it. Instead, I wired the remote stalk directly to my Arduino but thanks to all your recent work on the VAN bus, I overcame my "fear", big thanks for your work 😃

I have some suggestions regarding the Pioneer remotes and before I would like to get your input on it:

  • It's unclear which variant of the MPC41xxx you are using. The overall resistance for potentiometer is not the same for all MPC41 and that changes the resistance calculation.
    image
    So we could choose an MPC41xxx package and stick to it or allow the "user" to set value of the overall resistance used (maybe in the Pioneer_MCP4100_Remote constructor). The later option allows for better flexibility and ease-of-use.

I haven't properly looked at how you get the stalk commands for the VAN bus yet but from what I've seen, it may be possible to known if a particular button on the stalk command is being held. I think this can actually be helpful to, e.g.:

  • send source to the HU if the SRC button of the stalk is shortly pressed
  • send mute to the HU if the SRC button of the stalk is held for, say, 1sec
  • send on/off to the HU if the SRC button of the stalk is held for 2secs
    I hope you'll get the idea.

Hi,

Thanks for the kind words and suggestion, it is a good idea. The code for the MCP41xxx was imported from here. By looking at his code and schematics it seems he used an MCP41100. I have created a branch with the changes you proposed: f64fd45

Please take a look if I understood well what you meant. Unfortunately I am not that good at electronics, and reading their datasheets but tried my best. I am not sure what the RW value represents, so I made it as a parameter in the constructor.

As I wrote in the readme unfortunately I can't test these codes. I created the repository for those who are not sure how to read the remote controller status from the VAN bus, the remotes are just a kind of bonus :D Currently I am using an RD45 in my car, and don't have other headunits to test. So if you could verify it it would be awesome. Also if we could provide a schematics for the software it would be super-nice.

To support the long press of the buttons the current structure of the _Remote classes should be modified. So we would forward the button states in every iteration (currently it is only forwarded when a button is pressed). That way we could monitor when a button was pressed and when it was released from the _Remote classes.

Merged to master.