Difference between revisions of "Talk:Control"
Jump to navigation
Jump to search
Quisme Amat (talk | contribs) |
|||
Line 1: | Line 1: | ||
== unheld == | |||
Is this code snippet right? | Is this code snippet right? | ||
Line 18: | Line 19: | ||
With this new code, <code>unheld</code> would be true for any bit that was held low. | With this new code, <code>unheld</code> would be true for any bit that was held low. | ||
--- | |||
<nowiki>*kicks self*</nowiki> you are correct, I'll correct that, good catch. for some reason I though ~(level & edge) was going to be equivelent to ~level & ~edge. [[User:Strife Onizuka|Strife Onizuka]] 11:42, 2 March 2007 (PST) |
Revision as of 12:42, 2 March 2007
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)