Difference between revisions of "Talk:Control"
Jump to navigation
Jump to search
Quisme Amat (talk | contribs) |
Quisme Amat (talk | contribs) |
||
Line 16: | Line 16: | ||
integer unheld = ~level & ~edge; | integer unheld = ~level & ~edge; | ||
</code> | </code> | ||
With this new code, <code>unheld</code> would be true for any bit that was held low. |
Revision as of 07:01, 2 March 2007
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.