Search:

Type: Posts; User: dswartz2

Search: Search took 0.00 seconds.

  1. Replies
    11
    Views
    3,873

    I understand that last_state is equal to the old...

    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.
  2. Replies
    11
    Views
    3,873

    Ok, I am trying to run this program now, but I am...

    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
    ...
  3. Replies
    11
    Views
    3,873

    Yes I think that is exactly what I was looking...

    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!!
  4. Replies
    11
    Views
    3,873

    I can't ditch the outer if statement because I...

    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...
  5. Replies
    11
    Views
    3,873

    My original idea was this: if ((FLAG)F_SW...

    My original idea was this:



    if ((FLAG)F_SW == ON)
    {
    if ((FLAG)F_SW != ON)
    {
    (FLAG)F_SW_2 = ON;
    }
  6. Replies
    11
    Views
    3,873

    How to implement this condition..

    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...
  7. Ok, so if I used my original code and set up the...

    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 )
  8. Ok, so would it be as simple as just replacing...

    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 )
  9. Yes, I need it to start over using the value of...

    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?
  10. Question about variable's value being changed

    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...
Results 1 to 10 of 10