Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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