Skip to content

Instantly share code, notes, and snippets.

@simform-solutions
Created September 21, 2017 09:55
Show Gist options
  • Save simform-solutions/c076227725c51061f0b3128c83564839 to your computer and use it in GitHub Desktop.
Save simform-solutions/c076227725c51061f0b3128c83564839 to your computer and use it in GitHub Desktop.
#execute command according to transaction tag
#To turn on led use this command TURNONLED999999999999999999
#To turn off led use this command TURNOFFLED99999999999999999
#To rotate servo motor use this command TURNONSERVO9999999999999999
def execute_command(command):
print("Transaction tag: " + command)
if command == 'TURNONLED':
blink_led(True)
elif command == 'TURNOFFLED':
blink_led(False)
elif command == 'TURNONSERVO':
rotate_motor()
else:
print("Unsupported action")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment