The NEW Build Your Own Arcade Controls

Main => Main Forum => Topic started by: Ron_Michallick on January 13, 2019, 07:21:36 pm

Title: Broken micro-switches work with Led-Wiz Clone 2
Post by: Ron_Michallick on January 13, 2019, 07:21:36 pm
I have found that micro-switches that fail (using 'normally open' contact) usually have a working 'normally closed' contact.
With a small software change one can invert a joystick button input on the ledwiz clone panel.c file to match the normally closed connection.

Code: [Select]
uint8_t joy_b = 192;   //was 0 ; Joy button 7,8 being inverted.
...
case J1_Button1:
case J1_Button2:
case J1_Button3:
case J1_Button4:
case J1_Button5:
case J1_Button6:
joy_b |= JoyButtonBit(key);
break;

case J1_Button7:
case J1_Button8:
joy_b &= 255-JoyButtonBit(key);
break; //set inverted bit