Page 4 of 4 FirstFirst ... 234
Results 31 to 32 of 32

Thread: Timed Door

  1. #31
    Private pollo's Avatar
    Join Date
    Jul 2012
    Location
    Spain
    Posts
    116
    Thanks
    93
    Thanked 69 Times in 35 Posts
    But can i ask, what is the "if(t==10)" and "t++;" for?
    PHP Code:
    while( true 
        { 
            if(
    t==10//if "time" variable is equal to 10 (minutes)
            

    //do this
                
    door1 rotateyaw(90,2); 
                
    door2 rotateyaw(-90,2); 
                break; 
            } 
            
    t++; //add a minute to "time" variable
            
    wait 60//waits 60 seconds and restarts the loop if t (time variable) is not 10
        

    ----------------------------------------------------

    Hmm, i'm not sure what you mean with that, can you specify?
    (thread)

    thread: carries out a function independently of other functions

    For example:

    PHP Code:
    blas1();
    blas2();
    blas3(); 
    blas3(); will be carried out after the end of the blas2(); function, and this one will be carried out after the end of blas1();

    PHP Code:
    thread blas1();
    thread blas2();
    thread blas3(); 
    blas1(); blas2(); blas3(); will carry out at the same time.
    Last edited by pollo; 16th March 2014 at 14:17.

  2. #32
    Private
    Join Date
    Jan 2014
    Posts
    38
    Thanks
    9
    Thanked 1 Time in 1 Post
    Okey pollo. But i decided to close this project i have right now. So i will see later if i come back to it. Thanks for the support guys!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •