Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
You can send increment and decrement commands to it and clamp/read out its value.
So you can do an easy check of the w/s input, increment/decrement accordingly and just directly use the counters value as throttle.
If it is moving to fast you can add a timer that blocks consecutive commands. Just add an and-gate to check whether the timer is back to zero and you have a valid input.
to clarify - you want to create something like this:
IF cooldowntimer==0 AND Input==valid THEN increment/decrement END
a/d input -> Greater than 0 -> AND -> increment counter -> counter value to throttle output
then there is a little loop going from the AND gate to the timer and back into the AND gate
AND -> start/reset Timer -> Timer==0 -> AND
Setup the counter in such a way that its minimum value is 0 and its maximum value is 1. clamp between these values. Set increment steps as 0.1 or 0.01 depending on what kind of fine control you need.
Set up the timer with whatever delay seems reasonable to you (hows fast you want the throttle to change)
A valid input signal (bigger or less than zero) does two things: it increments/decrements the value and thus changes the throttle. It also start your cooldown timer. The and gate will only allow another change to the counter when the cooldown counter is done.
You can set up this system in a few different way depending on which kind of counter you use, you could use an invert, etc.
If you want to change the throttle step by step (lets say you have 5 speed leevels and each w/s input should only change the level up/down once) you can also use the impulse module. It will generate a one-time-only on signal on a rising edge. To switch up twice you need to click w, then release the key and then click w again.
just one of the possible ways to handle this kind of system. There are many other ways to do it, depending on how exactly you want your throttle to behave. but this is a relatively easy one for beginners, as the counter behaves very intuitive.
I want to use the numbers from w/d to actuate the on/off up and down of a lever. The counter does the reverse, i.e. translate on/off to number if I'm correct.
(Also by impulse module you meant the capacitor, is that right?)
Step 1: Set the sensitivity of the w/s to 100%, this is the key to the whole procedure, as it disables the "analog" control.
Step 2: Constant value 0 to the B input on greater than and less than logic, the throttle on A side
Step 3: Connect less than to down input on the throttle lever and greater than to up input.
Done :)
It's a bit more involved doing backwards (digital to analog input), but that's possible with the up/down counter.
Should also note that, after designing brakes that depend on hitting S while driving around, the delta reduction of the analog on release is not linear. The reduction of the reset analog works on a curve, which makes it very useful for its purpose, but not so kind to tying logic to it.
At the least it does respond to hitting the opposite direction, so you can make it react to sudden peaks... but like said before, the key is 100% sensitivity.
I ended up using the Delta to detect if I was pressing w or s and setting up on each branch a 1-tick clock looping on an AND gate like squall-leonhart1 suggested. I experienced a bit of confusion when having to chose between the four different timer types but managed it in the end.
Check it if you want to have a laugh : https://steamcommunity.com/sharedfiles/filedetails/?id=2049461956
Ra, why would you set the comparison value to 2 in your solution? (Since w/d output values from -1 to 1 I fail to see your reasoning.)
That's because literally when writing the message i was also working on something that i wrote the constant value 2 to. My brain wires crossed.
https://steamcommunity.com/sharedfiles/filedetails/?id=2049489862
For me it produces some weird behaviours - let me know whether they are intended:
1) due to the w/s input not immediately going back to 0 it stays active even without input
2) since you take the delta releasing the w button actually produces a throttle down signal
correct me if it is, but i assume this is not intended.
If all you want to do is move a throttle lever via the w/s control you really dont need more than a greater and lower than 0 check and output this directly to the throttle lever.
As Rasputin described this works best if you click on your seat and set the sensitivity of the w/s to 100% (otherwise you have a behaviour of slowly going back to zero after letting go of the key which produces a delayed input)
I forgot to mention that my solution is intended for a sticky analog input. I'm assuming the behaviour you observed stems from the fact that your control is to reset.
When I tried the simpler setup of greater or lesser check direct to the lever inputs, it was not very responsive, but I hadn't had the idea of playing with the sensitivity setting. I'll give this an another try and look at Ra's example as soon as I am done dragging this sample crucible with a motorised canoe in a storm.
What was tripping me up is that I only use sticky controls, I still lack intuition to tell when reset is a better idea.
At least I learned how to wire a timer to an AND gate! Thanks again everyone.
you can still use the timer if you want a slower change in throttle for more precise control.
so it wasnt for naught
What is the duration of a tick?