Skip to content

Instantly share code, notes, and snippets.

@kelliott121
Created May 25, 2017 16:59
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kelliott121/262977d894cdae57bf94469dd21a87e3 to your computer and use it in GitHub Desktop.
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