Made myself a button box/turn signal lever

GeorgeT93
Posts: 29
Joined: 30 Apr 2013 15:36

Made myself a button box/turn signal lever

#1 Post by GeorgeT93 » 23 Sep 2021 23:55

Started out planning on building a turn signal lever, which then expanded into a button box. Overall, I'm pretty happy with the way it came out and just wanted to share it. It took me quite a few revisions on the placement of the turn signal joystick before the joystick was finally sitting close enough to the right spot (despite sitting at an angle) to make it easier to find since I play in VR. Especially happy with the keyed ignition as I was able to get it to work the way it should by configuring it in the controls.sii file directly. :)
ButtonBox01.jpg
ButtonBox02.jpg
ButtonBox03.jpg
Fleepa
Posts: 3
Joined: 09 Sep 2019 05:11

Re: Made myself a button box/turn signal lever

#2 Post by Fleepa » 20 Nov 2021 14:20

Looks good! Been planning to make a button box myself. Im thinking of using a Zero Delay USB encoder to keep it simple and cheap, but from what i understand it has a limit of 16 buttons/functions. Arduino would allow for much more but at a higher cost and more work. You seem to have pretty much going on there, what board are you using?
GeorgeT93
Posts: 29
Joined: 30 Apr 2013 15:36

Re: Made myself a button box/turn signal lever

#3 Post by GeorgeT93 » 26 Nov 2021 06:57

Hi and thanks! I recently updated it as I wanted a latching lever for the trailer brake and also wired in a headlight switch. For this project, I just used 2 zero delay usb encoder boards. I just wanted something cheap that was plug and play and that I didn't have to spend time programming, although there is a little manual editing of the controls.sii file to make everything work correctly (mainly for assigning 'off' for the headlight and ignition switches).
ButtonBox04.jpg
For the ignition, the 'start' position was configured in-game, but the 'run' position and 'off' position were assigned directly in the controls.sii file (see example below). The 'off' position (ignitionoff) uses a 'not' qualifier (!) to tell the game to shut the electric if the button assigned to the 'run' position is not pressed (in my case, the board is identified by the game as joy4, and the run position is wired to button 1 and the start position is wired to button 2 (see the attached diagram which I used to track where I was wiring what).
(Example from my controls.sii file)
config_lines[301]: "mix engine `keyboard.e?0 | joy4.b2?0 | semantical.engine?0`"
config_lines[302]: "mix engineelect `semantical.engineelect?0`"
config_lines[303]: "mix ignitionoff `! joy4.b1?0 | semantical.ignitionoff?0`"
config_lines[304]: "mix ignitionon `joy4.b1?0 | semantical.ignitionon?0`"
config_lines[305]: "mix ignitionstrt `semantical.ignitionstrt?0`"

As you can see, the mix engine has joy4.b2 assigned to it to start the engine. This was done from within the game interface. I had to set it up to this assignment because I couldn't get the ignitionstrt value to work. The ignitionoff and ignitionon are not available to be programmed from within the game, so you have to edit the controls.sii file to assign keys/buttons to them. Since the button assigned to the 'on' (or what I've been referring to as the 'run' position) remains on even when the key moves to the 'start' position, then we just need to tell the controls.sii file that when that button is pressed, the ignition is on (joy4.b1), and when it isn't pressed, turn it off (! joy4.b1). Note that the space after the exclamation point may be required to indicate 'not' said value. Configuring it this way has allowed me to use the key just like a real ignition, and I don't have to turn it back to the accessory position to turn my engine off. Bonus is that the accessory position also works correctly with a wire jumped to the 'run' terminal on the ignition switch.

For the headlight switch, I opted for an old-school pull-on push-off style. This also required manually editing the controls.sii file as I believe these values are also not assignable from within the game interface (at least the 'off' position has to be manually configured to use the 'not' qualifier). The parking lights position is wired to button 11 and the headlights (low beam) are wired to button 12 (it's on the same board as the ignition, so it's still recognized as joy4 by my game). If you look at my example below, you'll see that I assigned the buttons that correspond to the switch positions, but for the 'lightoff' value I had to configure it for NOT joy4 button 11 AND NOT joy4 button 12. This is because the parking lights position (at least on the switch I'm using) disconnects when the switch is moved to the headlights position. So the lights will switch off when neither position is being triggered (when the switch is pushed back to the 'off' position).
(Example from my controls.sii file)
config_lines[344]: "mix lightoff `(! joy4.b11?0) & (! joy4.b12?0) | semantical.lightoff?0`"
config_lines[345]: "mix lightpark `joy4.b11?0 | semantical.lightpark?0`"
config_lines[346]: "mix lighton `joy4.b12?0 | semantical.lighton?0`"
Full Button Box Assignments - Twin Reyann Encoders.jpg
I've got my wheel and both boards plugged into a 4 port usb hub that I have attached behind the button boxes, so I only have to plug in the hub to my computer and all my driving controls are hooked up.

Hope this gives you enough info to help you get started, and let me know if you have any other questions and remember to post yours when you build it! :)

<Edited 12/18/2021 to update example line numbers to reflect their current locations in the controls.sii file.>
GeorgeT93
Posts: 29
Joined: 30 Apr 2013 15:36

Re: Made myself a button box/turn signal lever

#4 Post by GeorgeT93 » 21 May 2022 05:15

So I've completely redone my button box since this post. In fact, it's now two boxes and I've also added a shifter. I play in VR, so the buttons and switches I've used, along with their placement, were chosen to make it easy for me to find what I need when I'm driving (since I can't see the boxes), and after some time, muscle memory kicks in and you just kind of know where to reach for what. Everything is powered by two zero delay usb encoder boards, and one usb gamepad encoder board, so no programming of anything was required (aside from assigning things in-game and a couple of manual tweaks to the controls.sii file.) Anyhow, right after the adjustable suspension was announced, I added new switches to support those functions as well as for the lift axles (though up and down are still not currently programmable separately, so the bottoms of those two buttons are currently unassigned in-game.) Anyhow, here's where this setup has grown to since making my initial post last September. Hope you all like it. :)

Full view:
ButtonBox_144-01.jpg
Left side (Mirrors, windows, headlights, ignition, attach/detach and directionals lever):
ButtonBox_144-02.jpg
Right side (Trailer brake, wipers, parking brake, hazards, beacon, engine brake, retarder, suspension adjustments, lift axles, radio controls, vehicle adjustments, route advisor next page, route advisor mode, shifter range and splitter are wired into this box as well.):
ButtonBox_144-03.jpg
Notes: The ignition key switch, headlight switch and mirror controls all required manual configuration within the controls.sii file.

Anyhow, this is where it's progressed to, which I'm really happy with compared to where I started. I'd like to consider it "done", but I guess we'll see what future options may need to be added as SCS updates the games! :D
User avatar
PBandJ
Posts: 1296
Joined: 16 Jul 2019 22:54
Location: My computer chair...:)

Re: Made myself a button box/turn signal lever

#5 Post by PBandJ » 23 May 2022 12:43

Interesting post. I will have to see if I can figure out how to apply your settings in my controls.sii file so that the ignition switch works more like a true ignition switch. Mine currently I have to switch off and back on to shut down. Thank you for sharing this bit of information.
GeorgeT93
Posts: 29
Joined: 30 Apr 2013 15:36

Re: Made myself a button box/turn signal lever

#6 Post by GeorgeT93 » 23 May 2022 17:32

@PBandJ I actually made a guide that covers the changes you need to make to the controls.sii file that I posted on Steam in the guides section of both ATS and ETS2. Here's a link to the guide which should hopefully get your ignition switch working like a real one. https://steamcommunity.com/sharedfiles/ ... 2763180536. Give me a shout if you have any questions, I just updated the guides last night to reflect the current line numbers in the controls.sii file.
User avatar
PBandJ
Posts: 1296
Joined: 16 Jul 2019 22:54
Location: My computer chair...:)

Re: Made myself a button box/turn signal lever

#7 Post by PBandJ » 23 May 2022 20:51

@GeorgeT93 thanks for the link, I will look at it as soon as I can.
User avatar
PBandJ
Posts: 1296
Joined: 16 Jul 2019 22:54
Location: My computer chair...:)

Re: Made myself a button box/turn signal lever

#8 Post by PBandJ » 23 May 2022 22:42

@GeorgeT93 worked perfect for me. Thank you. One thing the line numbers for ATS is slightly different then what you had typed in the guide for ETS2. I think it started at line 315. Again, thanks!
GeorgeT93
Posts: 29
Joined: 30 Apr 2013 15:36

Re: Made myself a button box/turn signal lever

#9 Post by GeorgeT93 » 24 May 2022 00:11

@PBandJ Huh. I use the same controls.sii file for both, I have assumed the line numbers would be the same for everyone as there appear to be spots for 6 controller entries at the top of the file, regardless of whether or not 6 controllers are in use. In any case, glad to hear you got it working! :)
GeorgeT93
Posts: 29
Joined: 30 Apr 2013 15:36

Re: Made myself a button box/turn signal lever

#10 Post by GeorgeT93 » 24 May 2022 02:30

I have updated the guides again to remove references to 'hard' line numbers and to indicate that the line numbers in a user's file may differ from those in the example. Thanks for pointing out the discrepancy in the line numbers! :)
Locked

Return to “Offtopic and other voices”

Who is online

Users browsing this forum: ShadowScorpion_9 and 3 guests