American Truck Simulator

American Truck Simulator

View Stats:
building an ats button box
Hi everyone as the title suggest I am building a button box for ats/ets2. Just having afew issues that I can't seam to get my head around and hoping someone can help.
1. With the engine brake do I need to have a button for engine brake and engine brake toggle?
and
2. Do I need to have a switch to turn on/off the retarder?
< >
Showing 1-15 of 15 comments
Capt Fuzzy Feb 9, 2018 @ 9:42pm 
I'd think 'yes' for both...
Fury6 Feb 10, 2018 @ 12:14am 
Multiple ways of doing either depending on how you want it to work on your panel.

For the retarder, the game only has two inputs - one 'button' to increase retarder stage, another to decrease.

You could do this simply with a 1-pole 2-throw (SPDT) momentary-action rocker (3 position centre-return) of whatever style you like. That way you have the single hardware switch to operate both inputs. Wire the switch ON-OFF-ON. Remember, you want a momentary-action switch here.

You could also use a 3-throw switch (ON-ON-ON) and just leave the centre pole contact unwired.

You could also use a either a potentiometer+ADC or a rotary encoder instead to have a dial type action (though, many IRL are stalk lever action but this can be done with a rotary switch) but that's a little beyond the scope of a Steam discussion.
--

For the brake, there's both a toggle input (push-on/push-off) and a momentary-action (hold-on) input for the on/off mechanism plus the stage increase & decrease inputs - so there are a number of different ways you could go about this as well.

A simple and still fairly realistic way would be to use the same switching as the retarder above for the staging and a separate 1-pole 1-throw (SPST) toggle switch for the momentary (hold-on) input. This will give you the Jake system on/off toggle plus a *reasonably* realistic stage selector that can cope with any arbitrary number of stages.

You could of course also use a pot+ADC or rotary encoder for the stage selector here as well.
--

ATS doesn't allow direct selection of a specific Jake brake stage (the goal being generic flexibility), so you can't actually do something that's going to be truly realistic if you want a toggle switch type stage setup (most particularly for three stage, you can sort of 'wing' it with a two stage though all the vanilla trucks are three stage anyway).
Last edited by Fury6; Feb 10, 2018 @ 12:17am
Gotmeabeard Feb 10, 2018 @ 3:29am 
Thanks fury6 for the info has helped alot. Think I'll go towards the toggle switch idea rather than the rotary encoder.
Fury6 Feb 10, 2018 @ 6:04am 
NP. Some examples for centre return SPDT...

Toggle:
https://solarbotics.com/product/swt13/

Rocker:
https://www.jaycar.com.au/dpdt-switch-centre-off-spring-return-both-sides/p/SK0980
https://www.jaycar.com.au/spdt-centre-off-spring-return-both-sides/p/SK0987

The rocker style is usually a little easier and more comfortable to actuate than toggle.

[edit]
Personally, I really like these but... expensive due to higher rating plus can't find them with spring return :(.
https://www.jaycar.com.au/ip65-spdt-centre-off-rocker-switch-illuminated/p/SK0999
Last edited by Fury6; Feb 10, 2018 @ 6:06am
TechAffliction Feb 10, 2018 @ 6:11am 
The rotary encoder just has an extra wire. It's not hard to wire it up. The hard side is if you don't already know a programming language and have to write the code to handle the inputs. The cheapest solution for a "brain" for your box would be an Arduino Micro Pro. It has 16 inputs if I remember right and you can extended that to up to 128 inputs using shift registers. The Arduino IDE uses C which can be a bit much for someone that's never done programming before.
Though there are a million examples out there on how to turn an Arduino into an HID device.
Fury6 Feb 10, 2018 @ 6:27am 
Originally posted by TechAffliction:
[...]The Arduino IDE uses C which can be a bit much for someone that's never done programming before.
Though there are a million examples out there on how to turn an Arduino into an HID device.

True but OTOH the flexibility of having something so capable that you can programme yourself is worth almost any effort to learn. And you can start with someone else's programme, as you mention, and learn to mess with it hands-on at your own pace.

If you don't mind taking the time and making the effort, it's certainly the most flexible and ultimately most useful way to go about it IMHO.
TechAffliction Feb 10, 2018 @ 12:42pm 
I started learning C about 6 years ago playing around with PIC chips using MPLAB IDE. When I decided to use Arduinos for the Mega Shifter it was a straight transition. No need to learn new syntax. The number of libraries and sample programs available for Arduino is nothing short of amazing.
I went from writing programs that blinked LED lights in a pattern to writing data to an LED display and using the Arduino as an HID device literally in minutes.
TechAffliction Feb 10, 2018 @ 12:47pm 
If I were wanting to a Jake switch with multiple stages, I'd set it up using a potentiometer or a radiometric hall sensor then I'd program it so that it simulated a button press the required number of times to go from off to "high". Another option would be to use multiple digital hall sensors with a single magnet on the shaft so that when the shaft moves forward and back it triggers the separate sensors causing a button press. That would be far simpler to program and wouldn't require a PWM input.
Last edited by TechAffliction; Feb 10, 2018 @ 12:48pm
Gotmeabeard Feb 10, 2018 @ 1:49pm 
I'm leaning towards an arcade controller called the i-pac4 to control the box. It's a board that simulates keyboard strokes for 4 player mame/arcade systems. All i have to do is plug in the wires no coding needed. Running a 2 player version in my older button box works really well but doesn't have enough inputs for the new box I'm building.
TechAffliction Feb 10, 2018 @ 2:16pm 
I would rather have the output be joystick buttons personally. Simulated keystrokes are still keystrokes so you're limited to using it with games that allow keyboard input for the assignment in question. You're also limited to on/off functions, so no analog axis, PWM input or controlling LEDs from the board. It also appears that he's got all the button inputs as pull-up, so no way possible to do a lit rocker switch with it (they have to be wired in with a pull down resistor and trigger when the button receives power rather than when it shorts to ground like a normal switch).
Though it does look like it's extremely user friendly for someone that knows nothing about electronics or programming.

Edit:

https://www.sparkfun.com/tutorials/337
Simple tutorial for setting up an Arduino to emulate keystrokes.
Last edited by TechAffliction; Feb 10, 2018 @ 2:22pm
Fury6 Feb 10, 2018 @ 8:03pm 
Originally posted by TechAffliction:
I started learning C about 6 years ago playing[...]

I was agreeing with you, not referring to you -.- :P Arguably ambiguous wording, admittedly.
TechAffliction Feb 10, 2018 @ 9:10pm 
I was actually trying to encourage the OP.
Fury6 Feb 10, 2018 @ 9:19pm 
Originally posted by TechAffliction:
I was actually trying to encourage the OP.

Egg: 0
+
My face: =)
=

0)

Last edited by Fury6; Feb 10, 2018 @ 9:33pm
Gotmeabeard Feb 10, 2018 @ 9:30pm 
Though it does look like it's extremely user friendly for someone that knows nothing about electronics or programming.

Pretty much spot on techaffliction I'm making it it user friendly as much as possible as I have limited electronics knowledge and zero programming knowledge. So just expanding on what I know works for me at this stage. Not really concerned about led's mainly due to the fact that the buttons I'm using triple in price with led. Rotary dials would be nice for my lights and wipers tho.
Thanks for the link will be checking that out alittle later.
TechAffliction Feb 10, 2018 @ 10:29pm 
You can still use rotary switches, just not rotary encoders. A rotary encoder puts out two different pulses. It puts out an "A" pulse when you turn the knob clockwise and a "B" pulse when you turn the knob counterclockwise. Obviously you can't use it with something that's made to accept simple digital button inputs.
A rotary switch has multiple poles and a common ground. It will work fine with the keyboard encoder, it will just output a different key for each position you turn it to.
Last edited by TechAffliction; Feb 10, 2018 @ 10:30pm
< >
Showing 1-15 of 15 comments
Per page: 1530 50

Date Posted: Feb 9, 2018 @ 9:38pm
Posts: 15