Created
May 25, 2017 16:59
-
-
Save kelliott121/262977d894cdae57bf94469dd21a87e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
charNum = 0 | |
for char, prevChar in zip(packet[1], PrevPacket['K']): | |
if (char == '0') and (prevChar == '1'): | |
controller.device.emit(controller.devKeys[(controllerNum*Controller.NumButtons) + charNum], 1) | |
elif (char == '1') and (prevChar == '0'): | |
controller.device.emit(controller.devKeys[(controllerNum*Controller.NumButtons) + charNum], 0) | |
charNum = charNum + 1 | |
PrevPacket['K'] = packet[1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment