18 if (buf[i] != oldPad[i])
25 if (!match && joyEvents)
32 uint8_t hat = (buf[5] & 0xF);
35 if (hat != oldHat && joyEvents)
41 uint16_t buttons = (0x0000 | buf[6]);
43 buttons |= (buf[5] >> 4);
44 uint16_t changes = (buttons ^ oldButtons);
49 for (uint8_t i=0; i<0x0C; i++)
51 uint16_t mask = (0x0001 << i);
53 if (((mask & changes) > 0) && joyEvents)
54 if ((buttons & mask) > 0)
66 PrintHex<uint8_t>(evt->
X);
67 Serial.print(
"\tY: ");
68 PrintHex<uint8_t>(evt->
Y);
69 Serial.print(
"\tZ: ");
70 PrintHex<uint8_t>(evt->
Z1);
71 Serial.print(
"\tZ: ");
72 PrintHex<uint8_t>(evt->
Z2);
73 Serial.print(
"\tRz: ");
74 PrintHex<uint8_t>(evt->
Rz);
80 Serial.print(
"Hat Switch: ");
81 PrintHex<uint8_t>(hat);
88 Serial.println(but_id, DEC);
94 Serial.println(but_id, DEC);