[Microbit-Python] Sending an integer by radio
Stephen Simmons
mail at stevesimmons.com
Mon Dec 19 09:45:59 EST 2016
David,
If you are interested in a longer example of sending microbit motion data by radio, I did a talk on it at Pycon UK in September. The presentation and code are here in my github repo:
https://github.com/stevesimmons/pyconuk-motion-sensor-data-fusion
Stephen
Message: 6
Date: Mon, 19 Dec 2016 14:14:55 +0000
From: David Booth <david.f.booth at googlemail.com>
To: For Pythonic MicroBit related discussions <microbit at python.org>
Subject: Re: [Microbit-Python] Sending an integer by radio
Message-ID:
<CAMKGaEYZhqNmG+pCO3vLdqJ5B=fE=g7=d30QZt37WNkYNq6s4g at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi Mark
Nicholas Tollervey has just told me why my script does not work and
provided me with the following
What's the solution..? It's easy, you simply need to keep polling until
a message is received:
import radio
radio.on()
msg = None
while not msg:
msg = radio.receive()
my_number = int(msg)
Have a happy Christmas
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/microbit/attachments/20161219/6f17b6e1/attachment.html>
More information about the Microbit
mailing list