Created
June 11, 2014 08:04
-
-
Save miri64/cf748f9525d8a3cfa34e to your computer and use it in GitHub Desktop.
RIOT micropython vision
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
import RIOT.thread as thread | |
import RIOT.msg as msg | |
import RIOT.drivers.periph.gpio as gpio | |
class ReceiveThread(thread.Thread): | |
def run(): | |
while True: | |
m = msg.receive() | |
print "Received message: {:s}".format(m.content) | |
if str(m.content) == "On": | |
gpio.set(gpio.GPIO_0) | |
print("GPIO 0 was set") | |
else: | |
gpio.clear(gpio.GPIO_0) | |
print("GPIO 1 was set") | |
if __name__ == "__main__": | |
thread = ReceiveThread() | |
thread.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment