How do you convert various values to a simple 0/1 value?
I would like to be able to convert some values to 0 and 1 (as, 0 when they're 0 and 1 when they're everything else). This would help me with outputs such as R2/L2 and the sticks on the controller sensor, whose outputs give specific values rather than just 0 and 1, especially in the sticks case (having even the coordinates of the rotation included in the output). I just want to have a '1' signal when the DS4 sticks are being used, so that I can turn off and on other gadgets as I need when my logic detects the sticks have been moved.
I'm sure there's a simple solution but for the love of me I can't figure it out!
-
Most outputs of the controller sensor (button) sends a signal which is false/true (0/1).
For The L2/R2 and the sticks, you should use a greater than (in the calculator)
So, connect the signal from the output of the stick or L2/R2 to a calculator logic set on greater than, put it in A and have B as 0.
If A is then bigger than 0, you get a true signal.
Or check A to a number of your choice (B), this should get you on the right path. -
I thought about using the calculator but didn't have any luck with my attempts earlier, I'll try again but this time I'll follow your suggestions about how to set it up and see if it works properly.
Thanks for the input! -
Also, a button press in controller sensor only sends true when you hold it down!
I made a logic piece that is a true toggle for this, look up my psn and you'll find it under "True Logic" or something like it! -
'- Throw in a Calculator and set it to “Equal”.
- Connect a wire from the joystick/trigger of your choice to the A input.
- Keep the B value at 0.
- Connect the Result of the Calculator to a Not Gate.
Now the signal out of the Not Gate will be ON if the joystick/trigger detects any input. This is because the Calculator checks if the input is equal to zero (not active), and if so, sends an ON signal which the Not Gate inverts to an OFF one. Now if input is detected the Not Gate outputs an On signal.
Por favor, entrar para comentar.