Submitted by Steven Hepting (not verified) on Sat, 2008-04-12 21:55.
Wow, I got *exactly* the same code as you (down to the brackets even). Same shift, same AND with 0x03. Nice job.
Anyways, the only thing you want to do different is that c_button code. Right now it'll assign the value 0x02 to c_button if it's true and you want 1. Just use:
Exactly the same.
Wow, I got *exactly* the same code as you (down to the brackets even). Same shift, same AND with 0x03. Nice job.
Anyways, the only thing you want to do different is that c_button code. Right now it'll assign the value 0x02 to c_button if it's true and you want 1. Just use:
c_button = (outbuf[5] >> 1) & 0x01;