[Microbit-Python] Using micro-python to send simple radio commands?

M.-A. Lemburg mal at egenix.com
Fri Jul 8 06:38:51 EDT 2016


On 08.07.2016 10:00, Nicholas H.Tollervey wrote:
> Folks,
> 
> Yes, the draft API docs (here:
> https://github.com/bbcmicrobit/micropython/pull/305/files#diff-9670f8cd030b22f84c34b6dfd1dcdc5dR32)
> for the upcoming module describe a config method where you can override
> the defaults for: message length, queue size, channel number, power,
> address and data rate.
> 
> It'll have two send/receive methods: send_bytes/receive_bytes (for
> arbitrary bytes) and a simple convenience send/receive (for strings).
> The former allows advanced users to send any arbitrary data, the latter
> (for kids) facilitates the simplest possible messages with zero overhead.
> 
> FWIW, I was writing the C for this stuff on the train into work this
> morning. I should have it finished off this evening after my commute
> home. Will then be tested and I hope it'll be in master by the end of
> next week.

I'd make things a little more explicit and intuitive:

reset_config()
    reset everything to defaults

set_config(a=x, b=y)
    set config parameter a to x, b to y (this is
    essentially your config() except that it doesn't
    set non-given parameters to defaults)

get_config(x)
    return current value of parameter x

Hope this is ready for EuroPython :-)

BTW: What's the range of the MB radio communication ?

> Hope this helps.
> 
> N.
> 
> On 08/07/16 08:50, Ben Mustill-Rose wrote:
>> Hi,
>>
>> Are there plans to support changing the tx power using MicroPython?
>> I'm happy to send people prebuilt hex files if required - email me off list.
>>
>> Cheers,
>> Ben.
>>
>> On 7/7/16, Nicholas H.Tollervey <ntoll at ntoll.org> wrote:
>>> On 07/07/16 11:26, David Whale wrote:
>>>> Ben from BBC research recompiled MicroPython, and repackaged uflash and
>>>> mu and got it working himself recently for a coder dojo he was running.
>>>> He is bmustillrose on twitter, I'm sure he would share his build with
>>>> you if you wanted to get going quickly?
>>>>
>>>> David
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Microbit mailing list
>>>> Microbit at python.org
>>>> https://mail.python.org/mailman/listinfo/microbit
>>>>
>>>
>>> As it stands, it should be in the latest version of Mu / uFlash sometime
>>> at the end of next week.
>>>
>>> Updating the version of MicroPython on the BBC website is problematic.
>>>
>>> N.
>>>
>>>
>> _______________________________________________
>> Microbit mailing list
>> Microbit at python.org
>> https://mail.python.org/mailman/listinfo/microbit
>>
> 
> 
> 
> 
> _______________________________________________
> Microbit mailing list
> Microbit at python.org
> https://mail.python.org/mailman/listinfo/microbit
> 

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Experts (#1, Jul 08 2016)
>>> Python Projects, Coaching and Consulting ...  http://www.egenix.com/
>>> Python Database Interfaces ...           http://products.egenix.com/
>>> Plone/Zope Database Interfaces ...           http://zope.egenix.com/
________________________________________________________________________

::: We implement business ideas - efficiently in both time and costs :::

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/
                      http://www.malemburg.com/



More information about the Microbit mailing list