Created
July 10, 2017 12:04
-
-
Save seth10/d6c6e339331baaba64c0311bc30e046b to your computer and use it in GitHub Desktop.
Functional programming example on the PiStorms
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
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