nishikant195
Member
Is there any way to detect which bit is first ON in given set of bits
I have 8 button I want to know which button is first pressed,which button is second pressed,third,fourth etc
Is it possible
...
the down side is that ladder code runs to to bottom so if 2 buttons were received in the same scan only the first scanned will move the value
so for 99% of the time this system will work
I have 8 button I want to know which button is first pressed,which button is second pressed,third,fourth etc
Is it possible
--[ADD ]--
[SourceA sofar]
[SourceB 1]
[Dest ordinal]
btn0 sto0
--] [----]/[---+--[MOV ]------+--
| [Source ordinal] |
| [Dest ordinals[0]] |
| |
+--[MOV ]-----+
| [Source 0] |
| [Dest order[sofar]] |
| |
+--[ADD ]-----------+
[SourceA sofar]
[SourceB 1]
[Dest sofar]
Reset
--] [---[MOV ]--
[Source 0]
[Dest sofar]
btn0 Reset sto0
--+--] [---+--] [-----( )---
| |
| sto0 |
+--] [---+