Skip to content

Instantly share code, notes, and snippets.

@seth10
Created July 10, 2017 12:04
Show Gist options
  • Save seth10/d6c6e339331baaba64c0311bc30e046b to your computer and use it in GitHub Desktop.
Save seth10/d6c6e339331baaba64c0311bc30e046b to your computer and use it in GitHub Desktop.
Functional programming example on the PiStorms
from PiStorms import PiStorms
from TouchScreenInput import TouchScreenInput
from functools import partial
psm = PiStorms()
textbox = TouchScreenInput(psm.screen)
textbox.bind_led_on_func(partial(psm.led, 1, 255, 0, 0))
textbox.bind_led_off_func(partial(psm.led, 1, *[0]*3))
result = textbox.getInput()
psm.screen.showMessage(['Your answer', result['response']])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment