Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

how would I create a delay in output going high?

$
0
0

I am trying to put a piece of my program in with a time delay.  If I get input high for like a full second then the output will go high.

 

I tried with a long switch debounce, but the output still went high right after the input was there. 

{

if (P1IN & BIT3)              \\input high

    then (delay 2 seconds)     \\see if it stays there for 2 seconds
    
    P1OUT |= BIT6;             \\ make output high

    then (delay 60 second)     \\output high for 60 seconds

    P1OUT &= ~BIT6             \\reset P1OUT to low 
 


}

Thanks everybody!


Viewing all articles
Browse latest Browse all 2077

Trending Articles