Thread started: Apr 17 2008, 4:02 PM EDT
Watch
Name: Advanced Increment/Decrement Gate
Author: IEF015
Edited Chip: Increment/Decrement
Description: Increment/Decrement Gate with reset and more features.
Example Uses:
CODE:
N@Adv. Inc/Dec Chip v1
I@A Inc Dec Reset ResetTo Max Min
O@Value
Value += Inc * A
Value += Dec * -A
Reset -> Value = ResetTo;
Value > Max -> Value = Max;
Value < Min -> Value = Min;
ResetTo ? ResetTo : 0
Code explaination:
Line 1: "Value" equals "A" added when "Inc" is on
Line 2: "Value" equals "A" subtracted when "Dec" is on
Line 3: When "Reset" is on, "Value" equals "ResetTo"
Line 4: When "Value" is greater than "Max", then "Value" equals "Max"
Line 5: When "Value" is less than "Min", then "Value" equals "Min"
Line 6: When ResetTo has no input, then ResetTo will default to 0
0
out of
1 found this valuable.
Do you find this valuable?
Do you?
Show Last Reply
|
|
Last Reply:
RE: Advanced Increment/Decrement Chip
By: ,
Jun 1 2008, 4:43 AM EDT
Ah i see, you have a boolean value as Inc and Dec... You might wanna use the clamp command instead of line 4 and 5: N@Adv. Inc/Dec Chip v1 I@A Inc Dec Reset ResetTo Max Min O@Value Value += Inc * A Value += Dec * -A Value = (Reset ? ResetTo : Value) Value = clamp(Min, Value, Max)
out of
found this valuable.
Do you find this valuable?
|