1
0
mirror of https://github.com/mcgurk/Arduino-USB-HID-RetroJoystickAdapter synced 2024-12-22 15:38:49 -05:00

Added support for 2 buttons

This commit is contained in:
Jarno Lehtinen 2019-01-16 19:29:12 +02:00 committed by GitHub
parent a1bcfac0cb
commit fc24621cc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@ const uint8_t inputPinsPort1[] = { 5, 6, 7, 8, 0, 4, 0, 0, A2};
const uint8_t inputPinsPort2[] = {10, 16, 14, 15, 0, 3, 0, 0, A1};
//(1 = up, 2 = down, 3 = left, 4 = right, 6 = btn1, 9 = btn2)
#define DEBUG
//#define DEBUG
inline void translateState(uint8_t data, uint8_t *state) {
state[0] = !bitRead(data, 4) | !bitRead(data, 5)<<1;