I understand that last_state is equal to the old value of current state. I do not know how to set last_state equal to the old value.
Type: Posts; User: dswartz2
I understand that last_state is equal to the old value of current state. I do not know how to set last_state equal to the old value.
Ok, I am trying to run this program now, but I am not sure how to set the last_state to equal the previous state. Here is what I have:
FLAG last_state, curr_state;
last_state = OFF
loop
...
Yes I think that is exactly what I was looking for. I think I understand your idea, I will try to implement it in to my code. Thanks alot!!
I can't ditch the outer if statement because I only want the second flag (F_SW_2) to trigger after the first flag (F_SW) has been on and then now turned off. Then the second flag will only stay on...
My original idea was this:
if ((FLAG)F_SW == ON)
{
if ((FLAG)F_SW != ON)
{
(FLAG)F_SW_2 = ON;
}
Hello,
I need to implement the following condition in to my program which runs in 10ms cycles:
if (FLAG)F_SW == ON, then nothing needs to happen until F_SW turns OFF, in which I then want it to...
Ok, so if I used my original code and set up the while loop before it, then it should be ok...?
main( VOID )
x = 1
while ( x == 1 )
Ok, so would it be as simple as just replacing the first IF statement with a WHILE loop statement like this...?
main( VOID )
{
while ( vssAD_RLYD2 = 1 )
Yes, I need it to start over using the value of vssAD_RLYD2 that it got changed to during the program.
Which type of loop would be best to change this to?
Hello,
I have a basic question about setting a value to a certain variable, and then having the program change or update that value as it is executed. The program is pretty simple, it is a switch...