05-13-2021, 04:05 PM
(This post was last modified: 05-13-2021, 04:58 PM by Chrisfromwa.)
thanks, I'll take a look this afternoon and will let you know
Really appreciate your help with this! I went out and took a measurement. With my meter hooked to the line going to the mode switch, if I press any of the other buttons I'm not seeing any change in resistance. It only changes when I actually hit the mode button. So strange they made it differently between the 2 vehicles for the same time period.
Do you have a passion for cars?
Then create a page for it at Car Audio Central A great place to document and share your OpenAuto Pro projects.
05-14-2021, 04:42 PM
Just noticed that the forum merged my 2 replies into 1, so you may not have seen my second post.
When I hooked the meter to the mode line, pressing the scan/vol buttons doesn't seem to change anything. So they appear to be separate of each other. Let me know if there is anything else I can test/look for.
Do you have a passion for cars?
Then create a page for it at Car Audio Central A great place to document and share your OpenAuto Pro projects.
05-18-2021, 10:44 PM
Hi @interzen,
Hoping you're still able to help me with this, I'm think I'm getting closer but need your help with the code. Since my two wires don't seem to interact with each other, how does the code need to be updated to work with my setup? I'm looking at the code, and hoping you could help explain something. Here it says this //input pins #define WHEELCTRL1 A2 #define WHEELCTRL2 A1 If I'm reading this correctly WheelCTRL1 is looking at A2 and WheelCtrl2 looking at A1? Because here, seems to be the opposite of the above. (Which seems correct to me) int wheel_ctrl_1; // analog value of control pin 1 int wheel_ctrl_2; // analog value of control pin 2 If the above is correct, how does this check work? Because it seems like it's actually comparing against A2 not A1 as the comment says. wheel_ctrl_1 = analogRead(WHEELCTRL1); // Grab the Wheel Analog Value 1 Really hoping we can get this working, as this is the last puzzle piece that I need to get into place and then I can start installing everything into the car. Thanks again for your help Thanks! Chris
Do you have a passion for cars?
Then create a page for it at Car Audio Central A great place to document and share your OpenAuto Pro projects.
05-19-2021, 06:18 AM
Sorry for not seeing your response. Family emergency has me preoccupied ATM. I'll try to post modified code soon that will read both lines to determine if a button is checked.
05-26-2021, 08:10 PM
I got it working!
For anyone else who has a similar steering wheel controls as mine, here is how I did it. First I couldn't figure out the calculations for configuring the analog voltage. So what I did instead was used this code I found, to do it for me. Load this on your Arduino https://microcontrollerslab.com/analogre...o-example/
Once uploaded to your Arduino, hook your Pi/Arduino to your steering wheel control lines. Open the Arduino IDE and start the Serial monitor. YOu should see some numbers repeating over and over. Push one of the buttons on your wheel, as the button is pressed that number should change to something else. That is your analog voltage number. Do this with each button, and write down the numbers. On mine the 'Mode' button that is it's own line for some reason. So in the code above you have to switch from A1 and A2. Now that you have everything written down, you can take the code that interzen posted earlier. I had to modify it to make it work with my situation. Here is my code for 2 line inputs.
Now I went back to the car, hooked it all up again. BINGO! Everything worked! Hope this helps someone else out. The figuring out what analog voltages I needed in the code for each button was really getting me stuck. So that serial monitor piece made it really easy.
Do you have a passion for cars?
Then create a page for it at Car Audio Central A great place to document and share your OpenAuto Pro projects.
05-27-2021, 12:44 PM
Glad you worked it out, thanks for sharing!
I just read your post ( after disassembling my dash this morning and taking resistance measurements. ) I was prepared to tell you I would modify the code for you but see you have already figured out a working modification.
The only difference from mine is the mode line. I have the same resistances on the other line but my mode line is 201.7kΩ when nothing is pressed, 100.8kΩ with 'mode' pressed, 100.8kΩ with 'up' pressed, 101.2kΩ with 'down' pressed, 101.8kΩ with 'plus' pressed, and 104kΩ with 'minus' pressed. I think you had the two lines backwards which is why you had to swap the analog pins and why your non-mode analog values were different. Your divider resistors are likely swapped from my setup but it looks like there was still enough resolution to resolve which button was pressed. I am going to make my code universal, to support controls that don't change the mode line when other buttons are pressed, and add a scanning option for determining values for other 2 line (3 pin) Steering wheel controllers and other divider resistor choices. I'll post that soon and maybe make my first GitHub repository
big thanks to @interzen for providing that code and wiring.
i have a VW Touareg with a connects2 canbus adapter i had laying around. i had the idea of reading the adapter into an arduino and send keystrokes. but could not get good values to read. after i took your tip of a resistor to v_ref i suddenly got good values! i only have two buttons tho, for volume. when i used a 150ohm resistor i got values of 1014 for volume up and 1018 for volume down. they seem to be very close to each other, and close to the max of 1023. would a bigger resistor make those values lower? my steering wheel adapter has two wires and a ground out for "chineese learning brands" stereos. i am using those wires to read values. "key2" is always 1023. but "key1" is changing values with the key presses. https://www.hilmars-audio.dk/images/CTMULTILEAD.2.pdf i have no problems using it as it is. i was just wondering if my values would get lower with a bigger resistor. *EDIT* I tried with 2k resistors. i now got values of 910 and 940. and I like those values better. not so close to max. and not so close to each other. *EDIT END* and also i wanted to make a big thanks to interzen
01-05-2022, 04:11 AM
(This post was last modified: 01-05-2022, 02:32 PM by Daniel_BlueWave.)
Hi all, need some guidance please!
I'm deciding whether I want to go whole-hog in my vehicle and by that I mean repurposing the dash buttons for OAP functionality. I have a factory pop-up screen but it's only real function at the moment is displaying OSMC on a Pi 3 over RCA. The rest of the cars functions are in Japanese and Nav is also for Japan so I have no problem gutting it and fitting a touch-screen in it's place for OAP. I would like to re-use the buttons underneath though. Mainly for things like volume up/down, back/esc, answer/hang-up and also use the joystick on the far right for navigation and enter. Can I simply add resistors to the buttons and run them to a breadboard to pass to an Arduino? I saw someone mention 2k is a good step and had a look at the linked site for the resistance ladder. I should have enough space once I gut the unit to mount the breadboard and just run a few wires back to the Arduino for HID back to the Pi. This is what I'm working with; The controls above the HVAC are all for the Nav/Media/TV unit. |
|