I'm working on programming a sort of add-on function for an existing program and totally stuck on permanently changing a value after a triggered event. Basically the event triggers when a condition first changes from true to false, but the way I've been going about it... the new value only remains for a brief moment after the change... wanting to permanently change the value until a second condition changes it. Here's a simplified version of what I have without all the additional verbiage for the existing program.
1 2 3 4 5 6 7 8
Condition_A[Index] = 0 //by default
if(X[Index-1] ==1 && X[Index] ==0){
"Condition_A[Index] =1; }
//Currently A only equals 1 immediately after X changes from 1 to 0 then resets to the default value of zero... I need it to remain.
It is the default... but also needed to stay at zero until the it is triggered... I've tried creating different loops, thinking there has to be a way to tell it to permanently change the value when this happens.. just not really sure of the terminology I should be looking up
I understand all of that... let me explain a little more [index-1] represents 1 minute ago and [index] is current minute. Because what I'm doing requires "X" to be "1" a minute ago and "0" currently... It only changes "X" for 1 minute... then it reverts back to zero...