You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
in the "SNESpad_LED"-example I noticed that the LED for button A doesn't work
and a look into the header revealed:
#define SNES_A 0x100
#define SNES_X 0x200
#define SNES_L 0x400
#define SNES_R 0x800
So I tested it for A,X,L,R: all 4 are not working.
digitalWrite(5, state & SNES_A );
I don't know the signature of the digitalWrite function but it seems that there
is some implicit cast or an overflow wich prevents that 4 buttons (which are
bits 9-12 in the 'state' variable) testing the value to 'greater than 0' before
passing it to the function solves the problem:
digitalWrite(5, (state & SNES_A)>0 );
Anyway, this lib is great, it is easy to use and you have 12 buttons in no time
:D thanks for publishing it.
Original issue reported on code.google.com by [email protected] on 6 Jan 2011 at 9:56
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 6 Jan 2011 at 9:56The text was updated successfully, but these errors were encountered: