Talk:Control
Revision as of 11:42, 2 March 2007 by Strife Onizuka (talk | contribs)
unheld
Is this code snippet right?
integer start = level & edge;
integer end = ~level & edge;
integer held = level & ~edge;
integer unheld = ~(level & edge);
unheld
would be true for any bit that had a falling edge, was held high, or was held low. I think that last line should be...
integer unheld = ~(level | edge);
...or the equivalent...
integer unheld = ~level & ~edge;
With this new code, unheld
would be true for any bit that was held low.
---
*kicks self* you are correct, I'll correct that, good catch. for some reason I though ~(level & edge) was going to be equivelent to ~level & ~edge. Strife Onizuka 11:42, 2 March 2007 (PST)