Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/27/05 13:42
Read: times


 
#85925 - Detect edge .....
Responding to: ???'s previous message
To detect the edge of a signal you must use a periodic sampling in a loop that compares sample N-1 of the bit to the current N sample. When BIT_n-1 = 0 and BIT_n = 1 then you know that a positive edge has occurred. You can get by with two bit variables, one called Current_Bit and the other called Previous_Bit. Each time around the loop you move the value of Current_Bit into Previous_Bit. Once you see the 0/1 relationship between the values of Previous_Bit and Curent_Bit then you can stop the loop and because you have "seen" the edge.

Michael Karas


List of 8 messages in thread
TopicAuthorDate
Get Digital Input Once            01/01/70 00:00      
   Once            01/01/70 00:00      
      Detect edge .....            01/01/70 00:00      
         if it's edge detect            01/01/70 00:00      
   Hmm            01/01/70 00:00      
      edge detect            01/01/70 00:00      
   Once to transmit data to PC            01/01/70 00:00      
      things to consider            01/01/70 00:00      

Back to Subject List