From mal at egenix.com Tue Jan 5 17:41:27 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Tue, 5 Jan 2016 23:41:27 +0100 Subject: [Microbit-Python] Slowness as integers move beyond 256 Message-ID: <568C4697.3050609@egenix.com> I've been playing with MicroPython a bit and noticed a strange behavior: integer math gets rather slow when reaching numbers above 256. Run the attached script as example. It produces a wave on the LED display and runs quite nicely until the offset reaches 251. Performance then drops to about half the speed. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 05 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/ -------------- next part -------------- A non-text attachment was scrubbed... Name: waves.py Type: text/x-python Size: 800 bytes Desc: not available URL: From mal at egenix.com Tue Jan 5 17:47:15 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Tue, 5 Jan 2016 23:47:15 +0100 Subject: [Microbit-Python] Getting the Microbit into auto reset mode Message-ID: <568C47F3.1020207@egenix.com> Hello, the Microbit Monifa I playing around with seems to be in hard reset mode, that is: it will not automatically reset itself after flashing but instead require pressing the reset button to restart. In normal mode, the drive has a file "HARD_RST.CFG" with this content: """ # Behavior configuration file # Reset can be hard or auto # hard - user must disconnect power, press reset button or send a serial break command # auto - upon programming completion the target MCU automatically resets # and starts running # # The filename indicates how your board will reset the target # Delete this file to toggle the behavior # This setting can only be changed in maintenance mode """ Turning the Microbit into maintenance mode: https://www.mbed.com/en/development/hardware/prototyping-production/daplink/daplink-on-kl26z/ has the file show up as "HARD RST.CFG" (note the missing underscroe compared to normal mode) with this content: """ # Behavior configuration file # Reset can be hard or auto # hard - user must disconnect power, press reset button or send a serial break command # auto - upon programming completion, when the drive remounts the # target MCU automatically resets # # The filename indicates how your board will reset the target # Delete this file to toggle the behavior """ Deleting the file causes the Microbit to reset back into normal mode, but the filename doesn't change as expected to something like "AUTO_RST.CFG" and neither does the reset behavior change. Is there something I can do to get the MB into auto reset mode ? Thanks, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 05 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/ From mal at egenix.com Tue Jan 5 17:55:53 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Tue, 5 Jan 2016 23:55:53 +0100 Subject: [Microbit-Python] Slowness as integers move beyond 256 Message-ID: <568C49F9.9090503@egenix.com> [Sorry, hit send to early] I've been playing with MicroPython a bit and noticed a strange behavior: integer math gets rather slow when reaching numbers above 256. Run the attached script as example. It produces a wave on the LED display and runs quite nicely until the offset reaches 251. Performance then drops to about half the speed. Is this known behavior and expected ? I also noticed that the script stops when the offset reaches 500 with a MemoryError, even though the data structure for the LEDs is modified in place, so perhaps it's not the math that's slowing things down, but instead some memory leak. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 05 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/ -------------- next part -------------- A non-text attachment was scrubbed... Name: waves.py Type: text/x-python Size: 801 bytes Desc: not available URL: From damien.p.george at gmail.com Tue Jan 5 19:12:31 2016 From: damien.p.george at gmail.com (Damien George) Date: Wed, 6 Jan 2016 00:12:31 +0000 Subject: [Microbit-Python] Slowness as integers move beyond 256 In-Reply-To: <568C49F9.9090503@egenix.com> References: <568C49F9.9090503@egenix.com> Message-ID: Hi Marc-Andre, Wow, that's some really interesting behaviour! I can confirm both the slow down and MemoryError. The slow down at offset 252 is not due to integer arithmetic, but rather the underlying floating point implementation of the sine function. sin(201) is fast, sin(202) is slow (test it by making a function that computes the sine 200 times and see how fast it runs with different args). This is most likely due to the extra arithmetic that's needed to reduce large arguments (202 is large here) down to a range within -pi to pi (or something like that). As for the memory error, I'll need to look into that. The GC is not properly collecting the memory used to create the "offset" strings (everything else is inplace). Cheers, Damien. On Tue, Jan 5, 2016 at 10:55 PM, M.-A. Lemburg wrote: > [Sorry, hit send to early] > > I've been playing with MicroPython a bit and noticed a strange > behavior: integer math gets rather slow when reaching numbers > above 256. > > Run the attached script as example. It produces a wave on the > LED display and runs quite nicely until the offset reaches 251. > Performance then drops to about half the speed. > > Is this known behavior and expected ? > > I also noticed that the script stops when the offset reaches 500 > with a MemoryError, even though the data structure for the LEDs > is modified in place, so perhaps it's not the math that's slowing > things down, but instead some memory leak. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Experts (#1, Jan 05 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/ > > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > From mal at egenix.com Wed Jan 6 04:45:34 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 6 Jan 2016 10:45:34 +0100 Subject: [Microbit-Python] Slowness as integers move beyond 256 In-Reply-To: References: <568C49F9.9090503@egenix.com> Message-ID: <568CE23E.6020604@egenix.com> Hi Damien, On 06.01.2016 01:12, Damien George wrote: > Hi Marc-Andre, > > Wow, that's some really interesting behaviour! I can confirm both the > slow down and MemoryError. > > The slow down at offset 252 is not due to integer arithmetic, but > rather the underlying floating point implementation of the sine > function. sin(201) is fast, sin(202) is slow (test it by making a > function that computes the sine 200 times and see how fast it runs > with different args). This is most likely due to the extra arithmetic > that's needed to reduce large arguments (202 is large here) down to a > range within -pi to pi (or something like that). Thanks for the insight. I was just speculating on the reason and the break near 256 together with my use of an integer for the offset made it look like related to integers :-) I'll see whether I can use a different strategy to work around the sine range limit. > As for the memory error, I'll need to look into that. The GC is not > properly collecting the memory used to create the "offset" strings > (everything else is inplace). Ah, so the debug output is triggering this. That's interesting. Cheers, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 06 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/ > On Tue, Jan 5, 2016 at 10:55 PM, M.-A. Lemburg wrote: >> [Sorry, hit send to early] >> >> I've been playing with MicroPython a bit and noticed a strange >> behavior: integer math gets rather slow when reaching numbers >> above 256. >> >> Run the attached script as example. It produces a wave on the >> LED display and runs quite nicely until the offset reaches 251. >> Performance then drops to about half the speed. >> >> Is this known behavior and expected ? >> >> I also noticed that the script stops when the offset reaches 500 >> with a MemoryError, even though the data structure for the LEDs >> is modified in place, so perhaps it's not the math that's slowing >> things down, but instead some memory leak. >> >> -- >> Marc-Andre Lemburg >> eGenix.com >> >> Professional Python Services directly from the Experts (#1, Jan 05 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/ >> >> >> >> _______________________________________________ >> 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 > From nick.a.sarbicki at gmail.com Wed Jan 6 06:04:19 2016 From: nick.a.sarbicki at gmail.com (Nick Sarbicki) Date: Wed, 06 Jan 2016 11:04:19 +0000 Subject: [Microbit-Python] Slowness as integers move beyond 256 In-Reply-To: <568CE23E.6020604@egenix.com> References: <568C49F9.9090503@egenix.com> <568CE23E.6020604@egenix.com> Message-ID: > > > On Tue, Jan 5, 2016 at 10:55 PM, M.-A. Lemburg wrote: > >> [Sorry, hit send to early] > >> > >> I've been playing with MicroPython a bit and noticed a strange > >> behavior: integer math gets rather slow when reaching numbers > >> above 256. > >> > >> Run the attached script as example. It produces a wave on the > >> LED display and runs quite nicely until the offset reaches 251. > >> Performance then drops to about half the speed. > >> > >> Is this known behavior and expected ? > >> > >> I also noticed that the script stops when the offset reaches 500 > >> with a MemoryError, even though the data structure for the LEDs > >> is modified in place, so perhaps it's not the math that's slowing > >> things down, but instead some memory leak. > I find it interesting that it is happening around 256 - considering Python caches integers up to 256. Does MicroPython do the same? I know Damien has already pointed out how the Sine function slows down and I wouldn't normally think caching small integers could make that much of a difference. But could this also be related? - Nick. -------------- next part -------------- An HTML attachment was scrubbed... URL: From damien.p.george at gmail.com Wed Jan 6 07:28:02 2016 From: damien.p.george at gmail.com (Damien George) Date: Wed, 6 Jan 2016 12:28:02 +0000 Subject: [Microbit-Python] Slowness as integers move beyond 256 In-Reply-To: References: <568C49F9.9090503@egenix.com> <568CE23E.6020604@egenix.com> Message-ID: I think it's just a coincidence that it happens around i=256. MicroPython uses tagged pointers, so the integers that fit in 31-bits are stored within the object word itself, not on the heap. It does not have the same issues as CPython going from 257 to 258. The slow down is purely due to the sine computation. Since the argument to math.sin in waves.py is always a multiple of pi/4, you can just do the offset calculation modulo 8 and it'll be the same (offset = (offset + 1) % 8). On Wed, Jan 6, 2016 at 11:04 AM, Nick Sarbicki wrote: >> > On Tue, Jan 5, 2016 at 10:55 PM, M.-A. Lemburg wrote: >> >> [Sorry, hit send to early] >> >> >> >> I've been playing with MicroPython a bit and noticed a strange >> >> behavior: integer math gets rather slow when reaching numbers >> >> above 256. >> >> >> >> Run the attached script as example. It produces a wave on the >> >> LED display and runs quite nicely until the offset reaches 251. >> >> Performance then drops to about half the speed. >> >> >> >> Is this known behavior and expected ? >> >> >> >> I also noticed that the script stops when the offset reaches 500 >> >> with a MemoryError, even though the data structure for the LEDs >> >> is modified in place, so perhaps it's not the math that's slowing >> >> things down, but instead some memory leak. > > > I find it interesting that it is happening around 256 - considering Python > caches integers up to 256. Does MicroPython do the same? > > I know Damien has already pointed out how the Sine function slows down and I > wouldn't normally think caching small integers could make that much of a > difference. But could this also be related? > > - Nick. > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > From mal at egenix.com Wed Jan 6 09:04:01 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 6 Jan 2016 15:04:01 +0100 Subject: [Microbit-Python] Slowness as integers move beyond 256 In-Reply-To: References: <568C49F9.9090503@egenix.com> <568CE23E.6020604@egenix.com> Message-ID: <568D1ED1.2080601@egenix.com> I've fixed the logic for calculating the argument for math.sin() to always be in the range of 0..2*pi. This makes the slowness go away. BTW: I tried to film the waves display, but found that the LEDs appear to be using pulse-width modulation (PWM) to output different brightness levels. As a result the film doesn't show the nice modulation, but instead a more or less erratic blinking. Cheers, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 06 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/ From mal at egenix.com Wed Jan 6 09:12:12 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 6 Jan 2016 15:12:12 +0100 Subject: [Microbit-Python] Memory leak in print or string formatting In-Reply-To: <568D1ED1.2080601@egenix.com> References: <568C49F9.9090503@egenix.com> <568CE23E.6020604@egenix.com> <568D1ED1.2080601@egenix.com> Message-ID: <568D20BC.8040502@egenix.com> As for the memory error, I experimented a bit. Turns out that both %- and .format() formatting cause the problem, but not necessarily in the same way, e.g. the attached script runs fine (at least more than 1000 iterations) when using the %-formatting code, but fails with a MemoryError at offset 409 with the .format() approach: print ('Offset: %i' % offset) vs. print ('Offset: {}'.format(offset)) What's interesting is that when you change the display logic from: display_leds = display_leds_set_pixel to display_leds = display_leds_image_array The memory leak appears to go away. PS: I'm currently experimenting with the fastest way to display a list of lists on the LEDs. Cheers, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 06 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/ -------------- next part -------------- A non-text attachment was scrubbed... Name: waves.py Type: text/x-python Size: 1799 bytes Desc: not available URL: From mal at egenix.com Wed Jan 6 12:50:49 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 6 Jan 2016 18:50:49 +0100 Subject: [Microbit-Python] It's alive :-) Message-ID: <568D53F9.9030008@egenix.com> -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 06 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/ -------------- next part -------------- A non-text attachment was scrubbed... Name: alive.py Type: text/x-python Size: 1195 bytes Desc: not available URL: From dhylands at gmail.com Wed Jan 6 13:24:23 2016 From: dhylands at gmail.com (Dave Hylands) Date: Wed, 6 Jan 2016 10:24:23 -0800 Subject: [Microbit-Python] Slowness as integers move beyond 256 In-Reply-To: <568D1ED1.2080601@egenix.com> References: <568C49F9.9090503@egenix.com> <568CE23E.6020604@egenix.com> <568D1ED1.2080601@egenix.com> Message-ID: Hi, On Wed, Jan 6, 2016 at 6:04 AM, M.-A. Lemburg wrote: > I've fixed the logic for calculating the argument for math.sin() > to always be in the range of 0..2*pi. This makes the slowness > go away. > > BTW: I tried to film the waves display, but found that the LEDs > appear to be using pulse-width modulation (PWM) to output different > brightness levels. As a result the film doesn't show the nice modulation, > but instead a more or less erratic blinking. > I think that if you could increase the PWM frequency then you'd be able to film it. But that may or may not be possible (I'm not familiar with the underlying HW). -- Dave Hylands Shuswap, BC, Canada http://www.davehylands.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at thinkingbinaries.com Wed Jan 6 13:38:26 2016 From: david at thinkingbinaries.com (David Whale) Date: Wed, 6 Jan 2016 18:38:26 +0000 Subject: [Microbit-Python] Slowness as integers move beyond 256 In-Reply-To: <568D1ED1.2080601@egenix.com> References: <568C49F9.9090503@egenix.com> <568CE23E.6020604@egenix.com> <568D1ED1.2080601@egenix.com> Message-ID: The micro:bit uses BCM for the on screen LEDS (Binary Coded Modulation), and the update rate is such that it interferes quite badly with POV (persistence of vision) style implementations. I was chatting to Joe Finney at Lancaster about this and we came to the conclusion it's not worth 'going there', as the update rate of the display would need changing, and this would affect a range of other timing events. David. ___________________________________________________________ David Whale, B.Sc (Hons), MIET *Software Engineer and IET Schools Liaison Officer, Essex* email: dwhale at theiet.org twitter: @whaleygeek blog: blog.whaleygeek.co.uk Co-author of global bestselling book "Adventures in Minecraft" - lets get kids coding! Now in English, Spanish, Chinese and Russian. On 6 January 2016 at 14:04, M.-A. Lemburg wrote: > I've fixed the logic for calculating the argument for math.sin() > to always be in the range of 0..2*pi. This makes the slowness > go away. > > BTW: I tried to film the waves display, but found that the LEDs > appear to be using pulse-width modulation (PWM) to output different > brightness levels. As a result the film doesn't show the nice modulation, > but instead a more or less erratic blinking. > > Cheers, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Experts (#1, Jan 06 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/ > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at hotpy.org Wed Jan 6 13:51:56 2016 From: mark at hotpy.org (Mark Shannon) Date: Wed, 6 Jan 2016 18:51:56 +0000 Subject: [Microbit-Python] Slowness as integers move beyond 256 In-Reply-To: References: <568C49F9.9090503@egenix.com> <568CE23E.6020604@egenix.com> <568D1ED1.2080601@egenix.com> Message-ID: <568D624C.3050809@hotpy.org> Hi, We actually use an exponential scale of pwm duty-cycles, rather than bcm: https://github.com/bbcmicrobit/micropython/blob/master/source/microbit/microbitdisplay.cpp#L193 The shortest of which is only 35 microseconds. You'll need a fast camera :) The complete cycle to illuminate all the LEDs takes 18 millseconds. If you could film at some multiple of that rate, then apply a low-pass filter afterwards, you might get the correct visual effect. I doubt it is worth the effort. Cheers, Mark. On 06/01/16 18:38, David Whale wrote: > The micro:bit uses BCM for the on screen LEDS (Binary Coded Modulation), > and the update rate is such that it interferes quite badly with POV > (persistence of vision) style implementations. I was chatting to Joe > Finney at Lancaster about this and we came to the conclusion it's not > worth 'going there', as the update rate of the display would need > changing, and this would affect a range of other timing events. > > David. > > ___________________________________________________________ > David Whale, B.Sc (Hons), MIET > *Software Engineer and IET Schools Liaison Officer, Essex* > > email: dwhale at theiet.org > twitter: @whaleygeek > blog: blog.whaleygeek.co.uk > > Co-author of global bestselling book "Adventures in Minecraft" > - lets get kids coding! > Now in English, Spanish, Chinese and Russian. > > > On 6 January 2016 at 14:04, M.-A. Lemburg > wrote: > > I've fixed the logic for calculating the argument for math.sin() > to always be in the range of 0..2*pi. This makes the slowness > go away. > > BTW: I tried to film the waves display, but found that the LEDs > appear to be using pulse-width modulation (PWM) to output different > brightness levels. As a result the film doesn't show the nice > modulation, > but instead a more or less erratic blinking. > > Cheers, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Experts (#1, Jan 06 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/ > > _______________________________________________ > 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 > From foresmac at gmail.com Wed Jan 6 16:18:33 2016 From: foresmac at gmail.com (Chris Foresman) Date: Wed, 6 Jan 2016 15:18:33 -0600 Subject: [Microbit-Python] PWM duty cycles In-Reply-To: References: Message-ID: I?m looking at the list of constants, and I can?t help but think brightness 1 and 2 or possible reversed: https://github.com/bbcmicrobit/micropython/blob/master/source/microbit/microbitdisplay.cpp#L193-L206 Or maybe I?m crazy? Chris Foresman chris at chrisforesman.com > On Jan 6, 2016, at 12:57 PM, microbit-request at python.org wrote: > > We actually use an exponential scale of pwm duty-cycles, rather than bcm: > https://github.com/bbcmicrobit/micropython/blob/master/source/microbit/microbitdisplay.cpp#L193 From damien.p.george at gmail.com Wed Jan 6 16:44:26 2016 From: damien.p.george at gmail.com (Damien George) Date: Wed, 6 Jan 2016 21:44:26 +0000 Subject: [Microbit-Python] It's alive :-) In-Reply-To: <568D53F9.9030008@egenix.com> References: <568D53F9.9030008@egenix.com> Message-ID: Very pulsy, very cool! On Wed, Jan 6, 2016 at 5:50 PM, M.-A. Lemburg wrote: > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Experts (#1, Jan 06 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/ > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > From damien.p.george at gmail.com Wed Jan 6 16:48:05 2016 From: damien.p.george at gmail.com (Damien George) Date: Wed, 6 Jan 2016 21:48:05 +0000 Subject: [Microbit-Python] PWM duty cycles In-Reply-To: References: Message-ID: It's correct. The actual delay is the sum of all previous values. On Wed, Jan 6, 2016 at 9:18 PM, Chris Foresman wrote: > I?m looking at the list of constants, and I can?t help but think brightness 1 and 2 or possible reversed: > https://github.com/bbcmicrobit/micropython/blob/master/source/microbit/microbitdisplay.cpp#L193-L206 > > Or maybe I?m crazy? > > > > Chris Foresman > chris at chrisforesman.com > > > >> On Jan 6, 2016, at 12:57 PM, microbit-request at python.org wrote: >> >> We actually use an exponential scale of pwm duty-cycles, rather than bcm: >> https://github.com/bbcmicrobit/micropython/blob/master/source/microbit/microbitdisplay.cpp#L193 > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit From mal at egenix.com Wed Jan 6 16:48:04 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 6 Jan 2016 22:48:04 +0100 Subject: [Microbit-Python] It's alive :-) In-Reply-To: References: <568D53F9.9030008@egenix.com> Message-ID: <568D8B94.2000406@egenix.com> On 06.01.2016 22:44, Damien George wrote: > Very pulsy, very cool! Thanks :-) My kids liked it too. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 06 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/ From mal at egenix.com Thu Jan 7 06:40:55 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Thu, 7 Jan 2016 12:40:55 +0100 Subject: [Microbit-Python] Slowness as integers move beyond 256 In-Reply-To: <568D624C.3050809@hotpy.org> References: <568C49F9.9090503@egenix.com> <568CE23E.6020604@egenix.com> <568D1ED1.2080601@egenix.com> <568D624C.3050809@hotpy.org> Message-ID: <568E4EC7.206@egenix.com> On 06.01.2016 19:51, Mark Shannon wrote: > Hi, > > We actually use an exponential scale of pwm duty-cycles, rather than bcm: > https://github.com/bbcmicrobit/micropython/blob/master/source/microbit/microbitdisplay.cpp#L193 > > The shortest of which is only 35 microseconds. You'll need a fast camera :) > > The complete cycle to illuminate all the LEDs takes 18 millseconds. > If you could film at some multiple of that rate, then apply a low-pass > filter afterwards, you might get the correct visual effect. > I doubt it is worth the effort. Thanks, Mark. I found a trick to make it work: by lowering the ISO when filming the MB I can force the exposure time to higher values and then get the effect as what the human eye sees at some point: the flickering stops and you see smooth transitions in the video. Cheers, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 07 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/ From tom at viner.tv Thu Jan 7 07:18:32 2016 From: tom at viner.tv (Tom Viner) Date: Thu, 7 Jan 2016 12:18:32 +0000 Subject: [Microbit-Python] Memory leak in print or string formatting In-Reply-To: <568D20BC.8040502@egenix.com> References: <568C49F9.9090503@egenix.com> <568CE23E.6020604@egenix.com> <568D1ED1.2080601@egenix.com> <568D20BC.8040502@egenix.com> Message-ID: Yeah I've also had MemoryErrors with .format() too. In my case I was formatting floats though. If it's helpful I can try to find a minimal test case. As for the memory error, I experimented a bit. Turns out that both %- and .format() formatting cause the problem, but not necessarily in the same way, e.g. the attached script runs fine (at least more than 1000 iterations) when using the %-formatting code, but fails with a MemoryError at offset 409 with the .format() approach: print ('Offset: %i' % offset) vs. print ('Offset: {}'.format(offset)) What's interesting is that when you change the display logic from: display_leds = display_leds_set_pixel to display_leds = display_leds_image_array The memory leak appears to go away. PS: I'm currently experimenting with the fastest way to display a list of lists on the LEDs. Cheers, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 06 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/ _______________________________________________ Microbit mailing list Microbit at python.org https://mail.python.org/mailman/listinfo/microbit -------------- next part -------------- An HTML attachment was scrubbed... URL: From damien.p.george at gmail.com Thu Jan 7 18:32:31 2016 From: damien.p.george at gmail.com (Damien George) Date: Thu, 7 Jan 2016 23:32:31 +0000 Subject: [Microbit-Python] Memory leak in print or string formatting In-Reply-To: References: <568C49F9.9090503@egenix.com> <568CE23E.6020604@egenix.com> <568D1ED1.2080601@egenix.com> <568D20BC.8040502@egenix.com> Message-ID: Thanks for the bug report on this memory error. I tracked it down to string data not being zero'd out on initialisation (and hence keeping a pointer around which prevented the GC from reclaiming some memory, but in a very pathological way where all previous strings that were created with str.format were linked in a chain). A fix will appear soon. On Thu, Jan 7, 2016 at 12:18 PM, Tom Viner wrote: > Yeah I've also had MemoryErrors with .format() too. In my case I was > formatting floats though. > > If it's helpful I can try to find a minimal test case. > > As for the memory error, I experimented a bit. Turns out that > both %- and .format() formatting cause the problem, but not > necessarily in the same way, e.g. the attached script > runs fine (at least more than 1000 iterations) when using > the %-formatting code, but fails with a MemoryError at > offset 409 with the .format() approach: > > print ('Offset: %i' % offset) > vs. > print ('Offset: {}'.format(offset)) > > What's interesting is that when you change the display logic > from: > > display_leds = display_leds_set_pixel > > to > > display_leds = display_leds_image_array > > The memory leak appears to go away. > > PS: I'm currently experimenting with the fastest way to display > a list of lists on the LEDs. > > Cheers, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Experts (#1, Jan 06 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/ > > > _______________________________________________ > 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 > From carles at pina.cat Fri Jan 8 03:55:27 2016 From: carles at pina.cat (Carles Pina i Estany) Date: Fri, 8 Jan 2016 08:55:27 +0000 Subject: [Microbit-Python] compiling micro:bit: repo lancaster-university/microbit-dal doesn't exist Message-ID: <20160108085527.GB18964@pina.cat> Hello, I'm trying to compile https://github.com/bbcmicrobit/micropython using Debian Jeesie. So far so good but on the yt up step I have this error: info: Starting new HTTPS connection (1): registry.yottabuild.org error: Failed to satisfy dependencies of /home/carles/git/micropython: error: could not locate github component "lancaster-university/microbit-dal", either the name is misspelt, you do not have access to it, or it does not exist I can see on https://github.com/lancaster-university that lancaster-university doesn't exist. Any work arounds? Anything that I haven't done and I should have done? Perhaps the repo's name has been changed? (I haven't tried anything yet) It's my first time trying to compile it. Thank you! -- Carles Pina i Estany Web: http://pinux.info || Blog: http://pintant.cat GPG Key 0x8CD5C157 From david at thinkingbinaries.com Fri Jan 8 04:38:47 2016 From: david at thinkingbinaries.com (David Whale) Date: Fri, 8 Jan 2016 09:38:47 +0000 Subject: [Microbit-Python] compiling micro:bit: repo lancaster-university/microbit-dal doesn't exist In-Reply-To: <20160108085527.GB18964@pina.cat> References: <20160108085527.GB18964@pina.cat> Message-ID: You need to sign the NDA to get access to the lancaster DAL archives, as it has not yet been released to the public. Talk to Nicholas Tollervy and he can sort that out for you. David ___________________________________________________________ David Whale, B.Sc (Hons), MIET *Software Engineer and IET Schools Liaison Officer, Essex* email: dwhale at theiet.org twitter: @whaleygeek blog: blog.whaleygeek.co.uk Co-author of global bestselling book "Adventures in Minecraft" - lets get kids coding! Now in English, Spanish, Chinese and Russian. On 8 January 2016 at 08:55, Carles Pina i Estany wrote: > > Hello, > > I'm trying to compile https://github.com/bbcmicrobit/micropython using > Debian Jeesie. So far so good but on the yt up step I have this error: > info: Starting new HTTPS connection (1): registry.yottabuild.org > error: Failed to satisfy dependencies of /home/carles/git/micropython: > error: could not locate github component > "lancaster-university/microbit-dal", either the name is misspelt, you do > not have access to it, or it does not exist > > I can see on https://github.com/lancaster-university that > lancaster-university doesn't exist. > > Any work arounds? > > Anything that I haven't done and I should have done? Perhaps the repo's > name has been changed? (I haven't tried anything yet) > > It's my first time trying to compile it. > > Thank you! > > -- > Carles Pina i Estany > Web: http://pinux.info || Blog: http://pintant.cat > GPG Key 0x8CD5C157 > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mal at egenix.com Fri Jan 8 04:49:32 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Fri, 8 Jan 2016 10:49:32 +0100 Subject: [Microbit-Python] Memory leak in print or string formatting In-Reply-To: References: <568C49F9.9090503@egenix.com> <568CE23E.6020604@egenix.com> <568D1ED1.2080601@egenix.com> <568D20BC.8040502@egenix.com> Message-ID: <568F862C.8050506@egenix.com> On 08.01.2016 00:32, Damien George wrote: > Thanks for the bug report on this memory error. I tracked it down to > string data not being zero'd out on initialisation (and hence keeping > a pointer around which prevented the GC from reclaiming some memory, > but in a very pathological way where all previous strings that were > created with str.format were linked in a chain). > > A fix will appear soon. Thanks for tracking this down, Damien. Would it be possible to add a micropython module function to access the current heap size and/or used memory on the heap ? Something which allows detecting such memory errors when running loops. I think that would help with detecting such memory leaks. Cheers, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 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/ From ntoll at ntoll.org Fri Jan 8 06:19:25 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Fri, 8 Jan 2016 11:19:25 +0000 Subject: [Microbit-Python] compiling micro:bit: repo lancaster-university/microbit-dal doesn't exist In-Reply-To: <20160108085527.GB18964@pina.cat> References: <20160108085527.GB18964@pina.cat> Message-ID: <568F9B3D.8020508@ntoll.org> Hi Carles, I'll ping you an email. N. On 08/01/16 08:55, Carles Pina i Estany wrote: > > Hello, > > I'm trying to compile https://github.com/bbcmicrobit/micropython using > Debian Jeesie. So far so good but on the yt up step I have this error: > info: Starting new HTTPS connection (1): registry.yottabuild.org > error: Failed to satisfy dependencies of /home/carles/git/micropython: > error: could not locate github component > "lancaster-university/microbit-dal", either the name is misspelt, you do > not have access to it, or it does not exist > > I can see on https://github.com/lancaster-university that > lancaster-university doesn't exist. > > Any work arounds? > > Anything that I haven't done and I should have done? Perhaps the repo's > name has been changed? (I haven't tried anything yet) > > It's my first time trying to compile it. > > Thank you! > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From ntoll at ntoll.org Mon Jan 11 03:24:13 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 11 Jan 2016 08:24:13 +0000 Subject: [Microbit-Python] Towards a 1.0 Message-ID: <569366AD.3060508@ntoll.org> Hi Folks, Happy new year. TL;DR we need to get a 1.0 out the door asaps. If you have unfinished work / branches for MicroPython on the micro:bit please Please PLEASE can you get it finished / ready for review. Another important task is to update the developer documentation too since things have changed since the excellent initial work. Off the top of my head, there's still some image/display work Mark is working on, some bug fixes, the neo-pixel work and gestures that remain outstanding. We're *so* close. In other news... Over the autumn I visited lots of UK based Python user groups and teacher led events (mainly CAS related) to show people the work that has been done so far and so we can get feedback from teachers. The bottom line is that people love MicroPython but we need a *simple* and easy to set-up editor that exposes MicroPython in the best possible way for non-technical people such as ICT teachers (while the official web-based "TouchDevelop" is great, it doesn't allow you to automatically flash the device, doesn't include a REPL connection for live coding and requires that you're always connected to the internet). Since December I've been working on an alternative solution, called "Mu". It's almost feature complete while still being a work in progress. Check out this video for the current state of affairs: https://www.youtube.com/watch?v=zmOxOusMvjo We need testers for this! If you're interested drop me a line. It's definitely a work in progress, but progress is moving fast. The repos is here: https://github.com/ntoll/mu My autumnal research demonstrated that we also needed resources. To this end I've been running the micro-world-tour ~ an international community of Python developers have been building and sharing cool stuff that uses MicroPython on the micro:bit. Have a read here, I especially love the robots: http://microworldtour.github.io/ We also realised that teachers, developers and kids will need some easy way to share micro:bit output. With the help of the amazingly talented designer, Steve Hawkes I've done two things: 1) A very Wallace and Grommit "micro:bit-o-matic" hosted here: http://pycomic.github.io/microbit.html This lets you easily create and share simulations of the *outputs" from a micro:bit for demonstrative purposes (note - THIS IS NOT A FULL SIMULATOR - rather, it's a quick JavaScript hack so people can create, share and embed demos of micro:bit-y things). 2) We also had a batshit crazy idea to create a fun user-generated PyComic that can be included in educational resources. We want our resources to appeal to the 11yo target age group. So those with more of an affinity with visual rather than verbal instructions are catered for, we've decided to create some of our resources as comics. Our comics will feature "Yellow" and "Blue", the Python snakes..! (Yes, we've had approval from the PSF's trademark committee to use the modified snakes). Check out a proof of concept here (apologies to Guido - but it's such a lovely photograph): http://pycomic.github.io/?title=Testing%201,%202,%203...&author=@ntoll&bg1=bg/bbc_basic.gif&bg2=bg/guido.jpg&bg3=bg/doradus.jpg&h2=Meanwhile,%20somewhere%20in%20Holland...&s1=blue&s3=yellow&rb1=In%20the%20old%20days,%20programming%20looked%20like%20this..!&lb2=Hi,%20I%27m%20Guido%20van%20Rossum%20and%20I%20invented%20the%20Python%20programming%20language.<3=Now%20Python%20is%20even%20used%20in%20space,%20onboard%20the%20International%20Space%20Station%20on%20a%20Raspberry%20Pi Notice how the comic is specified in the URL (it's a static website so there's no backend and state is stored in the query string). You're probably asking, "that's a bit of a long URL isn't it?" to which I'd reply http://bit.ly/ have an API I'm going to use to make it easy[ier] to share these links. Again, another work in progress... I'm waiting on some design work from Steve before releasing the "editor" that'll allow you to create your own comics in a simple and easy to share way. It's important to note that these comics are not micro:bit specific - they could be used for any Python related resource and for comedic effect. As always, comments, constructive critique and ideas are most welcome! Best wishes, Nicholas. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From mal at egenix.com Mon Jan 11 03:48:18 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Mon, 11 Jan 2016 09:48:18 +0100 Subject: [Microbit-Python] Towards a 1.0 In-Reply-To: <569366AD.3060508@ntoll.org> References: <569366AD.3060508@ntoll.org> Message-ID: <56936C52.9050306@egenix.com> On 11.01.2016 09:24, Nicholas H.Tollervey wrote: > Hi Folks, > > Happy new year. > > TL;DR we need to get a 1.0 out the door asaps. If you have unfinished > work / branches for MicroPython on the micro:bit please Please PLEASE > can you get it finished / ready for review. Another important task is to > update the developer documentation too since things have changed since > the excellent initial work. Off the top of my head, there's still some > image/display work Mark is working on, some bug fixes, the neo-pixel > work and gestures that remain outstanding. We're *so* close. These are some things I found while playing with the MicroPython (so far): * Printing in the Python script will have the output show up on the console. This doesn't seem to be documented anywhere, but is very useful for debugging scripts. * Bug: microbit.Image() does not take keyword arguments http://microbit-micropython.readthedocs.org/en/latest/image.html * array only supports .extend() and .append() * arrays don't support buffer protocol * bytearray.extend() doesn't support iterators, only buffers * bytearrays don't support slice assignment, only index assignment * If you first run: microbit.display.animate(i, 100, stride=1, wait=False, loop=True) and then: microbit.display.animate(i, 100, stride=1) you get a deadlock. There's no way to stop the background animation. * need an API to query the available memory on the heap; useful for debugging memory leaks, but also to prevent MemoryErrors from crashing your script Should I open tickets for these somewhere ? Given the limitations under which MicroPython has to operate, some of these would likely be documentation bugs more than anything else. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 11 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/ From ssouravsingh12 at gmail.com Mon Jan 11 03:57:40 2016 From: ssouravsingh12 at gmail.com (Sourav Singh) Date: Mon, 11 Jan 2016 14:27:40 +0530 Subject: [Microbit-Python] Towards a 1.0 In-Reply-To: <56936C52.9050306@egenix.com> References: <569366AD.3060508@ntoll.org> <56936C52.9050306@egenix.com> Message-ID: Hello, I am really glad at the current state of progress for micro:bit. As it was mentioned, the Mu editor needs testing. I would like to help in testing the project, if possible. With Regards, Sourav Singh -------------- next part -------------- An HTML attachment was scrubbed... URL: From steve at blanc.ltd.uk Mon Jan 11 04:09:57 2016 From: steve at blanc.ltd.uk (Stephen Hawkes) Date: Mon, 11 Jan 2016 09:09:57 +0000 Subject: [Microbit-Python] Towards a 1.0 In-Reply-To: References: <569366AD.3060508@ntoll.org> <56936C52.9050306@egenix.com> <2d366d83c535e55c5ba56fb840003af7@frontapp.com> Message-ID: <2d366d83c535e55c5ba56fb840003af7@frontapp.com> Hi, We?re nearly there with a new world-tour website, and design on the forms for the comic editor. Next couple of days ok? Best ~Steve -- Blanc Limited Blythe Valley Innovation Centre Central Boulevard Solihull, B90 8AJ +44 (0) 33 33 44 7 800 www.blanc.ltd.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: From ntoll at ntoll.org Mon Jan 11 04:18:34 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 11 Jan 2016 09:18:34 +0000 Subject: [Microbit-Python] Towards a 1.0 In-Reply-To: <2d366d83c535e55c5ba56fb840003af7@frontapp.com> References: <569366AD.3060508@ntoll.org> <56936C52.9050306@egenix.com> <2d366d83c535e55c5ba56fb840003af7@frontapp.com> <2d366d83c535e55c5ba56fb840003af7@frontapp.com> Message-ID: <5693736A.3040408@ntoll.org> Great stuff! :-) N. On 11/01/16 09:09, Stephen Hawkes wrote: > Hi, > > We?re nearly there with a new world-tour website, and design on the > forms for the comic editor. > > Next couple of days ok? > > Best > > ~Steve > > > -- > > Blanc Limited > Blythe Valley Innovation Centre > Central Boulevard > Solihull, B90 8AJ > > +44 (0) 33 33 44 7 800 > www.blanc.ltd.uk > >> On Mon, Jan 11, 2016 at 08:58 am, > > Sourav Singh wrote: >> >> Hello, >> >> I am really glad at the current state of progress for micro:bit. As it >> was mentioned, the Mu editor needs testing. I would like to help in >> testing the project, if possible. >> >> With Regards, >> >> Sourav Singh > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From david at thinkingbinaries.com Mon Jan 11 04:45:50 2016 From: david at thinkingbinaries.com (David Whale) Date: Mon, 11 Jan 2016 09:45:50 +0000 Subject: [Microbit-Python] Towards a 1.0 In-Reply-To: <569366AD.3060508@ntoll.org> References: <569366AD.3060508@ntoll.org> Message-ID: Hi Nicholas, There are a couple of inaccuracies in your comparative statements: * (while the official web-based "TouchDevelop" is great, it doesn't allow you to automaticallyflash the device, doesn't include a REPL connection for live coding andrequires that you're always connected to the internet)* 1) "automatically flash": You can automatically flash the device using the micro:bit uploader: https://www.touchdevelop.com/microbituploader 2) "REPL" It's true, there is no REPL for blocks, code kingdoms or touch develop. They are all compiled languages without an interpretive runtime on the device, so this will probably always be the USP of MicroPython and I love it :) I'm sure one day though Microsoft will implement a remote debugger (it's not that hard, you only have to hook into the top loop), but it's still not the same as a REPL for an on-device interpreted language. 3) "always connected": You don't have to always be connected to the internet. You only have to connect once to get the editor cached in the browser cache, then you can use it offline indefinitely as the compiler is in the browser and the scripts are stored in the browser cache. The latest statement on the help pages say that children no longer need to log in. We use 28 laptops repeatedly without internet access and use TouchDevelop in schools with the micro:bit, and this works reliably providing you have cached the editor once. The kids use the new in browser SAVE and IMPORT features to transport their code around via USB memory sticks, which they are used to doing with all their other courses. 4) Also, don't forget, while MicroPython performs well, it is a *lot* slower than the other languages, because it is interpreted. I love MicroPython though, really enjoying using it! D ___________________________________________________________ David Whale, B.Sc (Hons), MIET *Software Engineer and IET Schools Liaison Officer, Essex* email: dwhale at theiet.org twitter: @whaleygeek blog: blog.whaleygeek.co.uk Co-author of global bestselling book "Adventures in Minecraft" - lets get kids coding! Now in English, Spanish, Chinese and Russian. On 11 January 2016 at 08:24, Nicholas H.Tollervey wrote: > Hi Folks, > > Happy new year. > > TL;DR we need to get a 1.0 out the door asaps. If you have unfinished > work / branches for MicroPython on the micro:bit please Please PLEASE > can you get it finished / ready for review. Another important task is to > update the developer documentation too since things have changed since > the excellent initial work. Off the top of my head, there's still some > image/display work Mark is working on, some bug fixes, the neo-pixel > work and gestures that remain outstanding. We're *so* close. > > In other news... > > Over the autumn I visited lots of UK based Python user groups and > teacher led events (mainly CAS related) to show people the work that has > been done so far and so we can get feedback from teachers. > > The bottom line is that people love MicroPython but we need a *simple* > and easy to set-up editor that exposes MicroPython in the best possible > way for non-technical people such as ICT teachers (while the official > web-based "TouchDevelop" is great, it doesn't allow you to automatically > flash the device, doesn't include a REPL connection for live coding and > requires that you're always connected to the internet). Since December > I've been working on an alternative solution, called "Mu". It's almost > feature complete while still being a work in progress. Check out this > video for the current state of affairs: > > https://www.youtube.com/watch?v=zmOxOusMvjo > > We need testers for this! If you're interested drop me a line. It's > definitely a work in progress, but progress is moving fast. The repos is > here: > > https://github.com/ntoll/mu > > My autumnal research demonstrated that we also needed resources. To this > end I've been running the micro-world-tour ~ an international community > of Python developers have been building and sharing cool stuff that uses > MicroPython on the micro:bit. Have a read here, I especially love the > robots: > > http://microworldtour.github.io/ > > We also realised that teachers, developers and kids will need some easy > way to share micro:bit output. With the help of the amazingly talented > designer, Steve Hawkes I've done two things: > > 1) A very Wallace and Grommit "micro:bit-o-matic" hosted here: > http://pycomic.github.io/microbit.html > > This lets you easily create and share simulations of the *outputs" from > a micro:bit for demonstrative purposes (note - THIS IS NOT A FULL > SIMULATOR - rather, it's a quick JavaScript hack so people can create, > share and embed demos of micro:bit-y things). > > 2) We also had a batshit crazy idea to create a fun user-generated > PyComic that can be included in educational resources. > > We want our resources to appeal to the 11yo target age group. So those > with more of an affinity with visual rather than verbal instructions are > catered for, we've decided to create some of our resources as comics. > > Our comics will feature "Yellow" and "Blue", the Python snakes..! (Yes, > we've had approval from the PSF's trademark committee to use the > modified snakes). > > Check out a proof of concept here (apologies to Guido - but it's such a > lovely photograph): > > > http://pycomic.github.io/?title=Testing%201,%202,%203...&author=@ntoll&bg1=bg/bbc_basic.gif&bg2=bg/guido.jpg&bg3=bg/doradus.jpg&h2=Meanwhile,%20somewhere%20in%20Holland...&s1=blue&s3=yellow&rb1=In%20the%20old%20days,%20programming%20looked%20like%20this..!&lb2=Hi,%20I%27m%20Guido%20van%20Rossum%20and%20I%20invented%20the%20Python%20programming%20language.<3=Now%20Python%20is%20even%20used%20in%20space,%20onboard%20the%20International%20Space%20Station%20on%20a%20Raspberry%20Pi > > Notice how the comic is specified in the URL (it's a static website so > there's no backend and state is stored in the query string). You're > probably asking, "that's a bit of a long URL isn't it?" to which I'd > reply http://bit.ly/ have an API I'm going to use to make it easy[ier] > to share these links. Again, another work in progress... > > I'm waiting on some design work from Steve before releasing the "editor" > that'll allow you to create your own comics in a simple and easy to > share way. It's important to note that these comics are not micro:bit > specific - they could be used for any Python related resource and for > comedic effect. > > As always, comments, constructive critique and ideas are most welcome! > > Best wishes, > > Nicholas. > > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ntoll at ntoll.org Mon Jan 11 04:47:35 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 11 Jan 2016 09:47:35 +0000 Subject: [Microbit-Python] Towards a 1.0 In-Reply-To: References: <569366AD.3060508@ntoll.org> Message-ID: <56937A37.2090001@ntoll.org> Thanks for the clarifications David. I wasn't familiar with much of the recent TD developments. Glad it works offline! N. On 11/01/16 09:45, David Whale wrote: > Hi Nicholas, > > There are a couple of inaccuracies in your comparative statements: > > / (while the official web-based "TouchDevelop" is great, it doesn't > allow you to automatically > flash the device, doesn't include a REPL connection for live coding and > requires that you're always connected to the internet) > / > > 1) "automatically flash": You can automatically flash the device using > the micro:bit uploader: > https://www.touchdevelop.com/microbituploader > > 2) "REPL" It's true, there is no REPL for blocks, code kingdoms or touch > develop. They are all compiled languages without an interpretive runtime > on the device, so this will probably always be the USP of MicroPython > and I love it :) I'm sure one day though Microsoft will implement a > remote debugger (it's not that hard, you only have to hook into the top > loop), but it's still not the same as a REPL for an on-device > interpreted language. > > 3) "always connected": You don't have to always be connected to the > internet. You only have to connect once to get the editor cached in the > browser cache, then you can use it offline indefinitely as the compiler > is in the browser and the scripts are stored in the browser cache. > > The latest statement on the help pages say that children no longer need > to log in. We use 28 laptops repeatedly without internet access and use > TouchDevelop in schools with the micro:bit, and this works reliably > providing you have cached the editor once. The kids use the new in > browser SAVE and IMPORT features to transport their code around via USB > memory sticks, which they are used to doing with all their other courses. > > 4) Also, don't forget, while MicroPython performs well, it is a *lot* > slower than the other languages, because it is interpreted. > > I love MicroPython though, really enjoying using it! > > D > > > > ___________________________________________________________ > David Whale, B.Sc (Hons), MIET > *Software Engineer and IET Schools Liaison Officer, Essex* > > email: dwhale at theiet.org > twitter: @whaleygeek > blog: blog.whaleygeek.co.uk > > Co-author of global bestselling book "Adventures in Minecraft" > - lets get kids coding! > Now in English, Spanish, Chinese and Russian. > > > On 11 January 2016 at 08:24, Nicholas H.Tollervey > wrote: > > Hi Folks, > > Happy new year. > > TL;DR we need to get a 1.0 out the door asaps. If you have unfinished > work / branches for MicroPython on the micro:bit please Please PLEASE > can you get it finished / ready for review. Another important task is to > update the developer documentation too since things have changed since > the excellent initial work. Off the top of my head, there's still some > image/display work Mark is working on, some bug fixes, the neo-pixel > work and gestures that remain outstanding. We're *so* close. > > In other news... > > Over the autumn I visited lots of UK based Python user groups and > teacher led events (mainly CAS related) to show people the work that has > been done so far and so we can get feedback from teachers. > > The bottom line is that people love MicroPython but we need a *simple* > and easy to set-up editor that exposes MicroPython in the best possible > way for non-technical people such as ICT teachers (while the official > web-based "TouchDevelop" is great, it doesn't allow you to automatically > flash the device, doesn't include a REPL connection for live coding and > requires that you're always connected to the internet). Since December > I've been working on an alternative solution, called "Mu". It's almost > feature complete while still being a work in progress. Check out this > video for the current state of affairs: > > https://www.youtube.com/watch?v=zmOxOusMvjo > > We need testers for this! If you're interested drop me a line. It's > definitely a work in progress, but progress is moving fast. The repos is > here: > > https://github.com/ntoll/mu > > My autumnal research demonstrated that we also needed resources. To this > end I've been running the micro-world-tour ~ an international community > of Python developers have been building and sharing cool stuff that uses > MicroPython on the micro:bit. Have a read here, I especially love the > robots: > > http://microworldtour.github.io/ > > We also realised that teachers, developers and kids will need some easy > way to share micro:bit output. With the help of the amazingly talented > designer, Steve Hawkes I've done two things: > > 1) A very Wallace and Grommit "micro:bit-o-matic" hosted here: > http://pycomic.github.io/microbit.html > > This lets you easily create and share simulations of the *outputs" from > a micro:bit for demonstrative purposes (note - THIS IS NOT A FULL > SIMULATOR - rather, it's a quick JavaScript hack so people can create, > share and embed demos of micro:bit-y things). > > 2) We also had a batshit crazy idea to create a fun user-generated > PyComic that can be included in educational resources. > > We want our resources to appeal to the 11yo target age group. So those > with more of an affinity with visual rather than verbal instructions are > catered for, we've decided to create some of our resources as comics. > > Our comics will feature "Yellow" and "Blue", the Python snakes..! (Yes, > we've had approval from the PSF's trademark committee to use the > modified snakes). > > Check out a proof of concept here (apologies to Guido - but it's such a > lovely photograph): > > http://pycomic.github.io/?title=Testing%201,%202,%203...&author=@ntoll&bg1=bg/bbc_basic.gif&bg2=bg/guido.jpg&bg3=bg/doradus.jpg&h2=Meanwhile,%20somewhere%20in%20Holland...&s1=blue&s3=yellow&rb1=In%20the%20old%20days,%20programming%20looked%20like%20this..!&lb2=Hi,%20I%27m%20Guido%20van%20Rossum%20and%20I%20invented%20the%20Python%20programming%20language.<3=Now%20Python%20is%20even%20used%20in%20space,%20onboard%20the%20International%20Space%20Station%20on%20a%20Raspberry%20Pi > > Notice how the comic is specified in the URL (it's a static website so > there's no backend and state is stored in the query string). You're > probably asking, "that's a bit of a long URL isn't it?" to which I'd > reply http://bit.ly/ have an API I'm going to use to make it easy[ier] > to share these links. Again, another work in progress... > > I'm waiting on some design work from Steve before releasing the "editor" > that'll allow you to create your own comics in a simple and easy to > share way. It's important to note that these comics are not micro:bit > specific - they could be used for any Python related resource and for > comedic effect. > > As always, comments, constructive critique and ideas are most welcome! > > Best wishes, > > Nicholas. > > > > _______________________________________________ > 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 > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From microbit at sheep.art.pl Mon Jan 11 04:56:40 2016 From: microbit at sheep.art.pl (Radomir Dopieralski) Date: Mon, 11 Jan 2016 10:56:40 +0100 Subject: [Microbit-Python] Towards a 1.0 In-Reply-To: References: <569366AD.3060508@ntoll.org> Message-ID: <20160111105640.6d08799c@ghostwheel> On Mon, 11 Jan 2016 09:45:50 +0000 David Whale wrote: > 2) "REPL" It's true, there is no REPL for blocks, code kingdoms or > touch develop. They are all compiled languages without an > interpretive runtime on the device, so this will probably always be > the USP of MicroPython and I love it :) I'm sure one day though > Microsoft will implement a remote debugger (it's not that hard, you > only have to hook into the top loop), but it's still not the same as > a REPL for an on-device interpreted language. I think a console can still be very useful even for a statically compiled language. There is a reason why the Arduino IDE has a Serial Monitor build-in. -- Radomir Dopieralski From mal at egenix.com Mon Jan 11 05:50:36 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Mon, 11 Jan 2016 11:50:36 +0100 Subject: [Microbit-Python] Towards a 1.0 In-Reply-To: References: <569366AD.3060508@ntoll.org> Message-ID: <569388FC.90709@egenix.com> On 11.01.2016 10:45, David Whale wrote: > 4) Also, don't forget, while MicroPython performs well, it is a *lot* > slower than the other languages, because it is interpreted. Regardless of the merits of the argument "interpreted vs. compiled", is the performance aspect really relevant for educational uses ? The one feature I'm still missing with MicroPython is a way to have modules, i.e. be able to place multiple Python files on the Microbit and have MicroPython then "import" them using the standard import statement. That would reduce the frequent copy&paste to get helper functions and classes ready for use by a script. Maybe something for a MicroPython 1.1 :-) I guess a preprocessor in the flash tool could emulate this by using classes as module namespaces: import myscript -> class myscript: # paste myscript.py here -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 11 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/ From ntoll at ntoll.org Mon Jan 11 05:54:15 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 11 Jan 2016 10:54:15 +0000 Subject: [Microbit-Python] Towards a 1.0 In-Reply-To: <569388FC.90709@egenix.com> References: <569366AD.3060508@ntoll.org> <569388FC.90709@egenix.com> Message-ID: <569389D7.70300@ntoll.org> I think MicroPython already implements import but because there's no FS on the device (to speak of) then it's counter-intuitive in some sense. Having said that, it could be implemented as some sort of pre-processor to the hexification process so the imported blocks of code are included in the final script. Make sense..? N. On 11/01/16 10:50, M.-A. Lemburg wrote: > On 11.01.2016 10:45, David Whale wrote: >> 4) Also, don't forget, while MicroPython performs well, it is a *lot* >> slower than the other languages, because it is interpreted. > > Regardless of the merits of the argument "interpreted vs. compiled", > is the performance aspect really relevant for educational uses ? > > The one feature I'm still missing with MicroPython is a way to > have modules, i.e. be able to place multiple Python files on > the Microbit and have MicroPython then "import" them using the standard > import statement. That would reduce the frequent copy&paste to > get helper functions and classes ready for use by a script. > > Maybe something for a MicroPython 1.1 :-) > > I guess a preprocessor in the flash tool could emulate this > by using classes as module namespaces: > > import myscript > -> > class myscript: > # paste myscript.py here > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From mal at egenix.com Mon Jan 11 10:43:45 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Mon, 11 Jan 2016 16:43:45 +0100 Subject: [Microbit-Python] Towards a 1.0 In-Reply-To: <569389D7.70300@ntoll.org> References: <569366AD.3060508@ntoll.org> <569388FC.90709@egenix.com> <569389D7.70300@ntoll.org> Message-ID: <5693CDB1.4020406@egenix.com> On 11.01.2016 11:54, Nicholas H.Tollervey wrote: > I think MicroPython already implements import but because there's no FS > on the device (to speak of) then it's counter-intuitive in some sense. > Having said that, it could be implemented as some sort of pre-processor > to the hexification process so the imported blocks of code are included > in the final script. > > Make sense..? Yep; see below for how the flash script could emulate modules by doing some syntax tweaking. The "import xyz" would just have to be rewritten to reference the class. There are likely a few things that need to be tweaked a little to get things working (e.g. to get multiple level imports to work), but overall it would make reusing code a lot more convenient. > N. > > On 11/01/16 10:50, M.-A. Lemburg wrote: >> On 11.01.2016 10:45, David Whale wrote: >>> 4) Also, don't forget, while MicroPython performs well, it is a *lot* >>> slower than the other languages, because it is interpreted. >> >> Regardless of the merits of the argument "interpreted vs. compiled", >> is the performance aspect really relevant for educational uses ? >> >> The one feature I'm still missing with MicroPython is a way to >> have modules, i.e. be able to place multiple Python files on >> the Microbit and have MicroPython then "import" them using the standard >> import statement. That would reduce the frequent copy&paste to >> get helper functions and classes ready for use by a script. >> >> Maybe something for a MicroPython 1.1 :-) >> >> I guess a preprocessor in the flash tool could emulate this >> by using classes as module namespaces: >> >> import myscript >> -> >> class myscript: >> # paste myscript.py here >> > > > > > _______________________________________________ > 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, Jan 11 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/ From nevil.hunt at hotmail.co.uk Mon Jan 11 11:10:04 2016 From: nevil.hunt at hotmail.co.uk (Nevil Hunt) Date: Mon, 11 Jan 2016 16:10:04 +0000 Subject: [Microbit-Python] Access to Microbit Python Message-ID: Hi, I am working with BBC Microbit partner Kitronik developing resources for the Microbit building on my Raspberry Pi Python programming challenges "Seven Segments of Pi" "The PiTrol" and "PiDapter" I'd like access to the Microbit Python programming environment. Would that be possible? Regards, Nevil Nevil HuntInnovations in Education -------------- next part -------------- An HTML attachment was scrubbed... URL: From ntoll at ntoll.org Mon Jan 11 11:18:27 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 11 Jan 2016 16:18:27 +0000 Subject: [Microbit-Python] Access to Microbit Python In-Reply-To: References: Message-ID: <5693D5D3.7070207@ntoll.org> Hi Neville, Two things, 1) To post to this list you need to be a list member - sign up here: https://mail.python.org/mailman/listinfo/microbit (Otherwise you won't get replies) 2) It depends what you mean by the Python programming environment. ;-) Completely happy to help with #2. The correct answer will depend upon who your target audience is. Can you tell me more about what you have in mind..? Happy to help in any way that I can, answer questions and give pointers etc... Best wishes, N. On 11/01/16 16:10, Nevil Hunt wrote: > Hi, > > I am working with BBC Microbit partner Kitronik developing resources for > the Microbit building on my Raspberry Pi Python programming challenges > "Seven Segments of Pi" "The PiTrol" and "PiDapter" > > I'd like access to the Microbit Python programming environment. Would > that be possible? > > Regards, > > Nevil > > > *Nevil Hunt* > *Innovations in Education* > * > * > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From damien.p.george at gmail.com Wed Jan 13 17:46:50 2016 From: damien.p.george at gmail.com (Damien George) Date: Wed, 13 Jan 2016 22:46:50 +0000 Subject: [Microbit-Python] Memory leak in print or string formatting In-Reply-To: <568F862C.8050506@egenix.com> References: <568C49F9.9090503@egenix.com> <568CE23E.6020604@egenix.com> <568D1ED1.2080601@egenix.com> <568D20BC.8040502@egenix.com> <568F862C.8050506@egenix.com> Message-ID: Hi Marc, This bug is now fixed! Latest version should work correctly. I tested it myself and I got up to 20,000 iterations :) (And then turned it off because I got bored, it never crashed.) There is already a module to inspect the heap: import micropython micropython.mem_info(1) Cheers, Damien. On Fri, Jan 8, 2016 at 9:49 AM, M.-A. Lemburg wrote: > On 08.01.2016 00:32, Damien George wrote: >> Thanks for the bug report on this memory error. I tracked it down to >> string data not being zero'd out on initialisation (and hence keeping >> a pointer around which prevented the GC from reclaiming some memory, >> but in a very pathological way where all previous strings that were >> created with str.format were linked in a chain). >> >> A fix will appear soon. > > Thanks for tracking this down, Damien. > > Would it be possible to add a micropython module function to access > the current heap size and/or used memory on the heap ? Something > which allows detecting such memory errors when running loops. > > I think that would help with detecting such memory leaks. > > Cheers, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Experts (#1, Jan 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/ > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit From ntoll at ntoll.org Fri Jan 15 17:07:21 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Fri, 15 Jan 2016 22:07:21 +0000 Subject: [Microbit-Python] We have an IRC channel - polite reminder about 1.0 Message-ID: <56996D99.1090606@ntoll.org> Hi Folks, A quick heads up... yesterday I set up a #microbit IRC channel on freenode. Perhaps see you in there sometime next week. We have around 12 people on there today discussing various microbit-y bits and bobs (mainly Python related). Remember we need to push for a 1.0!!! If you know there's going to be a problem contributing to this please shout! Finally, "mu" is coming on leaps and bounds. It's feature complete and tested on Windows, OSX, Linux and RaspberryPi. There needs to be some UI clean-ups and documentation but we're almost there. Have a great (and perhaps productive) weekend, :-) N. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From damien.p.george at gmail.com Mon Jan 18 07:51:12 2016 From: damien.p.george at gmail.com (Damien George) Date: Mon, 18 Jan 2016 12:51:12 +0000 Subject: [Microbit-Python] Towards a 1.0 In-Reply-To: <56936C52.9050306@egenix.com> References: <569366AD.3060508@ntoll.org> <56936C52.9050306@egenix.com> Message-ID: Hi Marc, Just now replying to your email from last week: > These are some things I found while playing with the MicroPython > (so far): > > * Printing in the Python script will have the output show > up on the console. This doesn't seem to be documented > anywhere, but is very useful for debugging scripts. This is a very basic thing, so basic that I don't know where it should be documented..! > * Bug: microbit.Image() does not take keyword arguments > http://microbit-micropython.readthedocs.org/en/latest/image.html Most functions/constructors/methods don't take keyword arguments, just positional. > * array only supports .extend() and .append() What were you missing? > * arrays don't support buffer protocol Can you be more specific? You can pass an array where a buffer is expected. > * bytearray.extend() doesn't support iterators, only buffers True. > * bytearrays don't support slice assignment, only index > assignment This feature was recently added upstream but it's not available in the microbit version (yet...). > * If you first run: > microbit.display.animate(i, 100, stride=1, wait=False, loop=True) > and then: > microbit.display.animate(i, 100, stride=1) > you get a deadlock. > There's no way to stop the background animation. We need to fix this. > * need an API to query the available memory on the heap; useful > for debugging memory leaks, but also to prevent MemoryErrors > from crashing your script This exists, try: import micropython micropython.mem_info(1) Cheers, Damien. From david.john.ames at gmail.com Tue Jan 19 20:37:24 2016 From: david.john.ames at gmail.com (Dave Ames) Date: Wed, 20 Jan 2016 01:37:24 +0000 Subject: [Microbit-Python] Towards a 1.0 In-Reply-To: References: <569366AD.3060508@ntoll.org> <56936C52.9050306@egenix.com> Message-ID: Hi All Although I've been following the list for a good while, until now I've not had access to a microbit to play with the code. (This is no longer the case ;-D !) What tasks need doing? Is there documentation or end user stuff that needs investigating? I've just submitted an issue to the Mu github repository, but is there anything else pressing that needs looking at from the perspective of an end user/teacher? Cheers Dave On Mon, 18 Jan 2016 12:51 Damien George wrote: > Hi Marc, > > Just now replying to your email from last week: > > > These are some things I found while playing with the MicroPython > > (so far): > > > > * Printing in the Python script will have the output show > > up on the console. This doesn't seem to be documented > > anywhere, but is very useful for debugging scripts. > > This is a very basic thing, so basic that I don't know where it should > be documented..! > > > * Bug: microbit.Image() does not take keyword arguments > > http://microbit-micropython.readthedocs.org/en/latest/image.html > > Most functions/constructors/methods don't take keyword arguments, just > positional. > > > * array only supports .extend() and .append() > > What were you missing? > > > * arrays don't support buffer protocol > > Can you be more specific? You can pass an array where a buffer is > expected. > > > * bytearray.extend() doesn't support iterators, only buffers > > True. > > > * bytearrays don't support slice assignment, only index > > assignment > > This feature was recently added upstream but it's not available in the > microbit version (yet...). > > > * If you first run: > > microbit.display.animate(i, 100, stride=1, wait=False, loop=True) > > and then: > > microbit.display.animate(i, 100, stride=1) > > you get a deadlock. > > There's no way to stop the background animation. > > We need to fix this. > > > * need an API to query the available memory on the heap; useful > > for debugging memory leaks, but also to prevent MemoryErrors > > from crashing your script > > This exists, try: > > import micropython > micropython.mem_info(1) > > Cheers, > Damien. > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mal at egenix.com Wed Jan 20 11:57:44 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 20 Jan 2016 17:57:44 +0100 Subject: [Microbit-Python] Microbit and Wifi Message-ID: <569FBC88.4020608@egenix.com> Hello all, I've been chatting a bit with Nicholas about the Bluetooth support in the MB and the problems with the stack using too much RAM, so I looked around a bit for alternatives and found this neat little device: RN1723: http://uk.farnell.com/microchip/rn1723-i-rm100/wlan-modul-802-11b-g-2-4ghz-spi/dp/2491385 http://www.microchip.com/wwwproducts/Devices.aspx?product=RN1723 Data sheet: http://ww1.microchip.com/downloads/en/DeviceDoc/70005224A.pdf Programming guide: http://ww1.microchip.com/downloads/en/DeviceDoc/50002230B.pdf It's fairly cheap, tiny, uses very little power when it's idle and comes with a really nice network stack to easily get a connection to a wifi network. Now, I'd love to play with this and see whether I can get it working, but need some help from someone who can point me to resources showing how to connect the pin casing to a breadboard. Even soldering looks like a problem, since the pins are tiny. Is there some kind of adapter I could order with the device to get me going ? Ideally one which doesn't require soldering. The closest I could find was this page: http://www.sm-breadboard.eu/ but none of those will fit the RN1723 case. PS: My electronics days are long over, so I'm using the Microbit as a bit of an excuse to slowly get into things again :-) Cheers, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 20 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/ From ntoll at ntoll.org Wed Jan 20 12:06:28 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Wed, 20 Jan 2016 17:06:28 +0000 Subject: [Microbit-Python] Microbit and Wifi In-Reply-To: <569FBC88.4020608@egenix.com> References: <569FBC88.4020608@egenix.com> Message-ID: <569FBE94.1070004@ntoll.org> Marc Andre, Edge connectors and breakout boards can be found here: https://www.kitronik.co.uk/catalogsearch/result/?q=microbit (Kitronik are one of the partners). N. On 20/01/16 16:57, M.-A. Lemburg wrote: > Hello all, > > I've been chatting a bit with Nicholas about the Bluetooth > support in the MB and the problems with the stack using > too much RAM, so I looked around a bit for alternatives > and found this neat little device: > > RN1723: > http://uk.farnell.com/microchip/rn1723-i-rm100/wlan-modul-802-11b-g-2-4ghz-spi/dp/2491385 > http://www.microchip.com/wwwproducts/Devices.aspx?product=RN1723 > > Data sheet: > http://ww1.microchip.com/downloads/en/DeviceDoc/70005224A.pdf > > Programming guide: > http://ww1.microchip.com/downloads/en/DeviceDoc/50002230B.pdf > > It's fairly cheap, tiny, uses very little power when it's > idle and comes with a really nice network stack to easily > get a connection to a wifi network. > > Now, I'd love to play with this and see whether I can get > it working, but need some help from someone who can point > me to resources showing how to connect the pin casing to > a breadboard. Even soldering looks like a problem, since the > pins are tiny. > > Is there some kind of adapter I could order with the device > to get me going ? Ideally one which doesn't require soldering. > > The closest I could find was this page: > > http://www.sm-breadboard.eu/ > > but none of those will fit the RN1723 case. > > PS: My electronics days are long over, so I'm using the Microbit > as a bit of an excuse to slowly get into things again :-) > > Cheers, > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From sparks.m at gmail.com Wed Jan 20 12:14:04 2016 From: sparks.m at gmail.com (Michael) Date: Wed, 20 Jan 2016 17:14:04 +0000 Subject: [Microbit-Python] Microbit and Wifi In-Reply-To: <569FBC88.4020608@egenix.com> References: <569FBC88.4020608@egenix.com> Message-ID: Probably the easiest way to play with that would be to get some PCB blank boards made up, which break out the pins to a standard 1/10" (2.54mm) pitch header, and then to use those. The way I'd do this would be: * Grab DesignSpark PCB * Copy the footprint in figure 1.6 (page 7 of that datasheet) to into a layout * Layout an appropriate header, and wire up the lines. * Generate the gerber files which relate to the layout *and* the drill holes (I used DesignSpark PCB because it didn't have any restrictions on usage or output - unlike (say) Eagle, and also it seemed relatively easy to use for someone who hadn't used it or anything like it before) If you keep it with a 5cm x 5cm size, then getting 10 blank PCBs printed up is about ?5 or so from various vendors (I've used DF Robot in the past). You can get a solder mask made up relatively cheaply from someon like http://www.smtstencil.co.uk/ - which would be a plastic - but works well. You can then practice your surface mount soldering using a kit like this: https://proto-pic.co.uk/simon-says-surface-mount-soldering-kit/ There's a few tutorials on youtube showing how to use a heatgun to do the actual soldering then. The heatgun I used was a cheap one from Argos (a well known store in the UK). It's both surprisingly scary and suprisingly easy. You'll also have **plenty** of solder left to use on your board.(Also that learning kit comes with a handful of other things you'd find useful) You can then play/enjoy. I followed this rough process when building prototype microbits in the kitchen - I've got photos of the process if they'd be helpful. (taking photos is a good way of zooming in to check the alignment of components before using the heatgun) You can then interface your board with the Kitronik breakout board Nick has mentioned. Michael. On 20 January 2016 at 16:57, M.-A. Lemburg wrote: > Hello all, > > I've been chatting a bit with Nicholas about the Bluetooth > support in the MB and the problems with the stack using > too much RAM, so I looked around a bit for alternatives > and found this neat little device: > > RN1723: > > http://uk.farnell.com/microchip/rn1723-i-rm100/wlan-modul-802-11b-g-2-4ghz-spi/dp/2491385 > http://www.microchip.com/wwwproducts/Devices.aspx?product=RN1723 > > Data sheet: > http://ww1.microchip.com/downloads/en/DeviceDoc/70005224A.pdf > > Programming guide: > http://ww1.microchip.com/downloads/en/DeviceDoc/50002230B.pdf > > It's fairly cheap, tiny, uses very little power when it's > idle and comes with a really nice network stack to easily > get a connection to a wifi network. > > Now, I'd love to play with this and see whether I can get > it working, but need some help from someone who can point > me to resources showing how to connect the pin casing to > a breadboard. Even soldering looks like a problem, since the > pins are tiny. > > Is there some kind of adapter I could order with the device > to get me going ? Ideally one which doesn't require soldering. > > The closest I could find was this page: > > http://www.sm-breadboard.eu/ > > but none of those will fit the RN1723 case. > > PS: My electronics days are long over, so I'm using the Microbit > as a bit of an excuse to slowly get into things again :-) > > Cheers, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Experts (#1, Jan 20 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/ > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -------------- next part -------------- An HTML attachment was scrubbed... URL: From microbit at sheep.art.pl Wed Jan 20 12:46:47 2016 From: microbit at sheep.art.pl (Radomir Dopieralski) Date: Wed, 20 Jan 2016 18:46:47 +0100 Subject: [Microbit-Python] Microbit and Wifi In-Reply-To: <569FBC88.4020608@egenix.com> References: <569FBC88.4020608@egenix.com> Message-ID: <20160120184647.3a062e98@ghostwheel> Perhaps you should try ESP8266, it's all the rage these days. If you pick the ESP-01 version, it has 2.54mm pitch pins which you can connect with standard dupont cables. The module comes with a firmware that lets you send and receive data over wifi using simple AT commands, but you can also program it yourself. There is even a port of micropython for it. On Wed, 20 Jan 2016 17:57:44 +0100 "M.-A. Lemburg" wrote: > Hello all, > > I've been chatting a bit with Nicholas about the Bluetooth > support in the MB and the problems with the stack using > too much RAM, so I looked around a bit for alternatives > and found this neat little device: > > RN1723: > http://uk.farnell.com/microchip/rn1723-i-rm100/wlan-modul-802-11b-g-2-4ghz-spi/dp/2491385 > http://www.microchip.com/wwwproducts/Devices.aspx?product=RN1723 > > Data sheet: > http://ww1.microchip.com/downloads/en/DeviceDoc/70005224A.pdf > > Programming guide: > http://ww1.microchip.com/downloads/en/DeviceDoc/50002230B.pdf > > It's fairly cheap, tiny, uses very little power when it's > idle and comes with a really nice network stack to easily > get a connection to a wifi network. > > Now, I'd love to play with this and see whether I can get > it working, but need some help from someone who can point > me to resources showing how to connect the pin casing to > a breadboard. Even soldering looks like a problem, since the > pins are tiny. > > Is there some kind of adapter I could order with the device > to get me going ? Ideally one which doesn't require soldering. > > The closest I could find was this page: > > http://www.sm-breadboard.eu/ > > but none of those will fit the RN1723 case. > > PS: My electronics days are long over, so I'm using the Microbit > as a bit of an excuse to slowly get into things again :-) > > Cheers, -- Radomir Dopieralski -- Radomir Dopieralski From dhylands at gmail.com Wed Jan 20 13:16:28 2016 From: dhylands at gmail.com (Dave Hylands) Date: Wed, 20 Jan 2016 10:16:28 -0800 Subject: [Microbit-Python] Microbit and Wifi In-Reply-To: <20160120184647.3a062e98@ghostwheel> References: <569FBC88.4020608@egenix.com> <20160120184647.3a062e98@ghostwheel> Message-ID: DigiKey carries the eval board for the RN1723 which looks to breakout the important signals: http://www.digikey.com/product-search/en/rf-if-and-rfid/rf-evaluation-and-development-kits-boards/3539644?k=RN1723 or in the UK: http://www.digikey.co.uk/product-search/en/rf-if-and-rfid/rf-evaluation-and-development-kits-boards/3539644?k=RN1723 On Wed, Jan 20, 2016 at 9:46 AM, Radomir Dopieralski wrote: > Perhaps you should try ESP8266, it's all the rage these days. > If you pick the ESP-01 version, it has 2.54mm pitch pins which > you can connect with standard dupont cables. > > The module comes with a firmware that lets you send and receive > data over wifi using simple AT commands, but you can also program > it yourself. There is even a port of micropython for it. > > On Wed, 20 Jan 2016 17:57:44 +0100 > "M.-A. Lemburg" wrote: > > > Hello all, > > > > I've been chatting a bit with Nicholas about the Bluetooth > > support in the MB and the problems with the stack using > > too much RAM, so I looked around a bit for alternatives > > and found this neat little device: > > > > RN1723: > > > http://uk.farnell.com/microchip/rn1723-i-rm100/wlan-modul-802-11b-g-2-4ghz-spi/dp/2491385 > > http://www.microchip.com/wwwproducts/Devices.aspx?product=RN1723 > > > > Data sheet: > > http://ww1.microchip.com/downloads/en/DeviceDoc/70005224A.pdf > > > > Programming guide: > > http://ww1.microchip.com/downloads/en/DeviceDoc/50002230B.pdf > > > > It's fairly cheap, tiny, uses very little power when it's > > idle and comes with a really nice network stack to easily > > get a connection to a wifi network. > > > > Now, I'd love to play with this and see whether I can get > > it working, but need some help from someone who can point > > me to resources showing how to connect the pin casing to > > a breadboard. Even soldering looks like a problem, since the > > pins are tiny. > > > > Is there some kind of adapter I could order with the device > > to get me going ? Ideally one which doesn't require soldering. > > > > The closest I could find was this page: > > > > http://www.sm-breadboard.eu/ > > > > but none of those will fit the RN1723 case. > > > > PS: My electronics days are long over, so I'm using the Microbit > > as a bit of an excuse to slowly get into things again :-) > > > > Cheers, > > > > -- > Radomir Dopieralski > > -- > Radomir Dopieralski > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -- Dave Hylands Shuswap, BC, Canada http://www.davehylands.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mal at egenix.com Wed Jan 20 14:53:34 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 20 Jan 2016 20:53:34 +0100 Subject: [Microbit-Python] Microbit and Wifi In-Reply-To: <20160120184647.3a062e98@ghostwheel> References: <569FBC88.4020608@egenix.com> <20160120184647.3a062e98@ghostwheel> Message-ID: <569FE5BE.5090806@egenix.com> On 20.01.2016 18:46, Radomir Dopieralski wrote: > Perhaps you should try ESP8266, it's all the rage these days. > If you pick the ESP-01 version, it has 2.54mm pitch pins which > you can connect with standard dupont cables. > > The module comes with a firmware that lets you send and receive > data over wifi using simple AT commands, but you can also program > it yourself. There is even a port of micropython for it. Thanks, Radomir. Do you have the URL for the MicroPython port ? I found that device too after I had posted the RN1723 email below when trying to find related things on Amazon. There is a *lot* of information available for it on the net and it only costs EUR 3 or so when shipped from China. The major advantage I see is that it plugs directly into the breadboard without any soldering. The interfacing is not as easy as for the RN1723, though, which uses clear text commands, whereas the ESP8266 uses cryptic AT commands. ESP8266 Specs: http://espressif.com/en/products/esp8266/ ESP8266 Docs: http://bbs.espressif.com/viewtopic.php?f=67&t=225 I guess I'll give the ESP8266 a try first and then fall back to the RN1723. > On Wed, 20 Jan 2016 17:57:44 +0100 > "M.-A. Lemburg" wrote: > >> Hello all, >> >> I've been chatting a bit with Nicholas about the Bluetooth >> support in the MB and the problems with the stack using >> too much RAM, so I looked around a bit for alternatives >> and found this neat little device: >> >> RN1723: >> http://uk.farnell.com/microchip/rn1723-i-rm100/wlan-modul-802-11b-g-2-4ghz-spi/dp/2491385 >> http://www.microchip.com/wwwproducts/Devices.aspx?product=RN1723 >> >> Data sheet: >> http://ww1.microchip.com/downloads/en/DeviceDoc/70005224A.pdf >> >> Programming guide: >> http://ww1.microchip.com/downloads/en/DeviceDoc/50002230B.pdf >> >> It's fairly cheap, tiny, uses very little power when it's >> idle and comes with a really nice network stack to easily >> get a connection to a wifi network. >> >> Now, I'd love to play with this and see whether I can get >> it working, but need some help from someone who can point >> me to resources showing how to connect the pin casing to >> a breadboard. Even soldering looks like a problem, since the >> pins are tiny. >> >> Is there some kind of adapter I could order with the device >> to get me going ? Ideally one which doesn't require soldering. >> >> The closest I could find was this page: >> >> http://www.sm-breadboard.eu/ >> >> but none of those will fit the RN1723 case. >> >> PS: My electronics days are long over, so I'm using the Microbit >> as a bit of an excuse to slowly get into things again :-) >> >> Cheers, > > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 20 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/ From mal at egenix.com Wed Jan 20 15:00:13 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 20 Jan 2016 21:00:13 +0100 Subject: [Microbit-Python] Microbit and Wifi In-Reply-To: References: <569FBC88.4020608@egenix.com> Message-ID: <569FE74D.90500@egenix.com> Hi Michael, thanks for the great reply. I'll see whether I can find a PCB print shop in Germany to handle printing. Will probably need to get a new soldering station for the SMT soldering :-) BTW: I already mentioned this to Nicholas, but perhaps there's some interest here as well: there's a project originally run by a German university called "Fritzing" which aims to make it easier for kids to play with things like PCBs. Perhaps there's some synergy which both the Microbit community and the Fritzing community could benefit from: http://fritzing.org/home/ (all open source, easy to use, extensible, etc.) Cheers, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Jan 20 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/ On 20.01.2016 18:14, Michael wrote: > Probably the easiest way to play with that would be to get some PCB blank > boards made up, which break out the pins to a standard 1/10" (2.54mm) pitch > header, and then to use those. > > The way I'd do this would be: > > * Grab DesignSpark PCB > * Copy the footprint in figure 1.6 (page 7 of that datasheet) to into a > layout > * Layout an appropriate header, and wire up the lines. > * Generate the gerber files which relate to the layout *and* the drill holes > > (I used DesignSpark PCB because it didn't have any restrictions on usage or > output - unlike (say) Eagle, and also it seemed relatively easy to use for > someone who hadn't used it or anything like it before) > > If you keep it with a 5cm x 5cm size, then getting 10 blank PCBs printed up > is about ?5 or so from various vendors (I've used DF Robot in the past). > > You can get a solder mask made up relatively cheaply from someon like > http://www.smtstencil.co.uk/ - which would be a plastic - but works well. > > You can then practice your surface mount soldering using a kit like this: > > https://proto-pic.co.uk/simon-says-surface-mount-soldering-kit/ > > There's a few tutorials on youtube showing how to use a heatgun to do the > actual soldering then. The heatgun I used was a cheap one from Argos (a > well known store in the UK). It's both surprisingly scary and suprisingly > easy. > > You'll also have **plenty** of solder left to use on your board.(Also that > learning kit comes with a handful of other things you'd find useful) > > You can then play/enjoy. > > I followed this rough process when building prototype microbits in the > kitchen - I've got photos of the process if they'd be helpful. (taking > photos is a good way of zooming in to check the alignment of components > before using the heatgun) > > You can then interface your board with the Kitronik breakout board Nick has > mentioned. > > > Michael. > > > On 20 January 2016 at 16:57, M.-A. Lemburg wrote: > >> Hello all, >> >> I've been chatting a bit with Nicholas about the Bluetooth >> support in the MB and the problems with the stack using >> too much RAM, so I looked around a bit for alternatives >> and found this neat little device: >> >> RN1723: >> >> http://uk.farnell.com/microchip/rn1723-i-rm100/wlan-modul-802-11b-g-2-4ghz-spi/dp/2491385 >> http://www.microchip.com/wwwproducts/Devices.aspx?product=RN1723 >> >> Data sheet: >> http://ww1.microchip.com/downloads/en/DeviceDoc/70005224A.pdf >> >> Programming guide: >> http://ww1.microchip.com/downloads/en/DeviceDoc/50002230B.pdf >> >> It's fairly cheap, tiny, uses very little power when it's >> idle and comes with a really nice network stack to easily >> get a connection to a wifi network. >> >> Now, I'd love to play with this and see whether I can get >> it working, but need some help from someone who can point >> me to resources showing how to connect the pin casing to >> a breadboard. Even soldering looks like a problem, since the >> pins are tiny. >> >> Is there some kind of adapter I could order with the device >> to get me going ? Ideally one which doesn't require soldering. >> >> The closest I could find was this page: >> >> http://www.sm-breadboard.eu/ >> >> but none of those will fit the RN1723 case. >> >> PS: My electronics days are long over, so I'm using the Microbit >> as a bit of an excuse to slowly get into things again :-) >> >> Cheers, >> -- >> Marc-Andre Lemburg >> eGenix.com >> >> Professional Python Services directly from the Experts (#1, Jan 20 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/ >> >> _______________________________________________ >> 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 > From mal at egenix.com Wed Jan 20 15:09:29 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Wed, 20 Jan 2016 21:09:29 +0100 Subject: [Microbit-Python] Microbit and Wifi In-Reply-To: References: <569FBC88.4020608@egenix.com> <20160120184647.3a062e98@ghostwheel> Message-ID: <569FE979.3080406@egenix.com> On 20.01.2016 19:16, Dave Hylands wrote: > DigiKey carries the eval board for the RN1723 which looks to breakout the > important signals: > http://www.digikey.com/product-search/en/rf-if-and-rfid/rf-evaluation-and-development-kits-boards/3539644?k=RN1723 > or in the UK: > http://www.digikey.co.uk/product-search/en/rf-if-and-rfid/rf-evaluation-and-development-kits-boards/3539644?k=RN1723 Thanks, Dave. This looks like a possible solution as well - albeit a rather pricey one :-) > On Wed, Jan 20, 2016 at 9:46 AM, Radomir Dopieralski > wrote: > >> Perhaps you should try ESP8266, it's all the rage these days. >> If you pick the ESP-01 version, it has 2.54mm pitch pins which >> you can connect with standard dupont cables. >> >> The module comes with a firmware that lets you send and receive >> data over wifi using simple AT commands, but you can also program >> it yourself. There is even a port of micropython for it. >> >> On Wed, 20 Jan 2016 17:57:44 +0100 >> "M.-A. Lemburg" wrote: >> >>> Hello all, >>> >>> I've been chatting a bit with Nicholas about the Bluetooth >>> support in the MB and the problems with the stack using >>> too much RAM, so I looked around a bit for alternatives >>> and found this neat little device: >>> >>> RN1723: >>> >> http://uk.farnell.com/microchip/rn1723-i-rm100/wlan-modul-802-11b-g-2-4ghz-spi/dp/2491385 >>> http://www.microchip.com/wwwproducts/Devices.aspx?product=RN1723 >>> >>> Data sheet: >>> http://ww1.microchip.com/downloads/en/DeviceDoc/70005224A.pdf >>> >>> Programming guide: >>> http://ww1.microchip.com/downloads/en/DeviceDoc/50002230B.pdf >>> >>> It's fairly cheap, tiny, uses very little power when it's >>> idle and comes with a really nice network stack to easily >>> get a connection to a wifi network. >>> >>> Now, I'd love to play with this and see whether I can get >>> it working, but need some help from someone who can point >>> me to resources showing how to connect the pin casing to >>> a breadboard. Even soldering looks like a problem, since the >>> pins are tiny. >>> >>> Is there some kind of adapter I could order with the device >>> to get me going ? Ideally one which doesn't require soldering. >>> >>> The closest I could find was this page: >>> >>> http://www.sm-breadboard.eu/ >>> >>> but none of those will fit the RN1723 case. >>> >>> PS: My electronics days are long over, so I'm using the Microbit >>> as a bit of an excuse to slowly get into things again :-) >>> >>> Cheers, >> >> >> >> -- >> Radomir Dopieralski >> >> -- >> Radomir Dopieralski >> _______________________________________________ >> 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, Jan 20 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/ From microbit at sheep.art.pl Wed Jan 20 15:21:53 2016 From: microbit at sheep.art.pl (Radomir Dopieralski) Date: Wed, 20 Jan 2016 21:21:53 +0100 Subject: [Microbit-Python] Microbit and Wifi In-Reply-To: <569FE5BE.5090806@egenix.com> References: <569FBC88.4020608@egenix.com> <20160120184647.3a062e98@ghostwheel> <569FE5BE.5090806@egenix.com> Message-ID: <20160120212153.1d57ded0@ghostwheel> The micropython port is in a kind of unfinished experimental state, but there is a tutorial on how to compile and upload it here: https://learn.adafruit.com/building-and-running-micropython-on-the-esp8266/ I also worked a bit on the documentation for it, so it should be mostly up to date. Unfortunately, due to the way it is organized, it's not possible to make it available on readthedocs or similar service, so you will have to build it with Sphinx locally. Other than that, there is also an Adroid core for that board, so you can use the Arduino IDE to program it, which gives you a much more complete control over the board. The AT commands are plain-text, but you can of course write your own program that communicates with the Micro:bit in any way you want. If you use the I?C interface, for instance, you will still have the REPL available on the serial console. You could have a HTTP server running on the ESP8266, for instance... On Wed, 20 Jan 2016 20:53:34 +0100 "M.-A. Lemburg" wrote: > On 20.01.2016 18:46, Radomir Dopieralski wrote: > > Perhaps you should try ESP8266, it's all the rage these days. > > If you pick the ESP-01 version, it has 2.54mm pitch pins which > > you can connect with standard dupont cables. > > > > The module comes with a firmware that lets you send and receive > > data over wifi using simple AT commands, but you can also program > > it yourself. There is even a port of micropython for it. > > Thanks, Radomir. Do you have the URL for the MicroPython port ? > > I found that device too after I had posted the RN1723 email > below when trying to find related things on Amazon. There is > a *lot* of information available for it on the net and it only > costs EUR 3 or so when shipped from China. The major advantage > I see is that it plugs directly into the breadboard without > any soldering. > > The interfacing is not as easy as for the RN1723, though, > which uses clear text commands, whereas the ESP8266 uses > cryptic AT commands. > > ESP8266 Specs: > http://espressif.com/en/products/esp8266/ > > ESP8266 Docs: > http://bbs.espressif.com/viewtopic.php?f=67&t=225 > > I guess I'll give the ESP8266 a try first and then fall back > to the RN1723. > > > > On Wed, 20 Jan 2016 17:57:44 +0100 > > "M.-A. Lemburg" wrote: > > > >> Hello all, > >> > >> I've been chatting a bit with Nicholas about the Bluetooth > >> support in the MB and the problems with the stack using > >> too much RAM, so I looked around a bit for alternatives > >> and found this neat little device: > >> > >> RN1723: > >> http://uk.farnell.com/microchip/rn1723-i-rm100/wlan-modul-802-11b-g-2-4ghz-spi/dp/2491385 > >> http://www.microchip.com/wwwproducts/Devices.aspx?product=RN1723 > >> > >> Data sheet: > >> http://ww1.microchip.com/downloads/en/DeviceDoc/70005224A.pdf > >> > >> Programming guide: > >> http://ww1.microchip.com/downloads/en/DeviceDoc/50002230B.pdf > >> > >> It's fairly cheap, tiny, uses very little power when it's > >> idle and comes with a really nice network stack to easily > >> get a connection to a wifi network. > >> > >> Now, I'd love to play with this and see whether I can get > >> it working, but need some help from someone who can point > >> me to resources showing how to connect the pin casing to > >> a breadboard. Even soldering looks like a problem, since the > >> pins are tiny. > >> > >> Is there some kind of adapter I could order with the device > >> to get me going ? Ideally one which doesn't require soldering. > >> > >> The closest I could find was this page: > >> > >> http://www.sm-breadboard.eu/ > >> > >> but none of those will fit the RN1723 case. > >> > >> PS: My electronics days are long over, so I'm using the Microbit > >> as a bit of an excuse to slowly get into things again :-) > >> > >> Cheers, > > > > > > > -- Radomir Dopieralski -- Radomir Dopieralski From david.john.ames at gmail.com Thu Jan 28 18:45:18 2016 From: david.john.ames at gmail.com (Dave Ames) Date: Thu, 28 Jan 2016 23:45:18 +0000 Subject: [Microbit-Python] Porting the TouchDevelop Examples to MicroPython Message-ID: Hi I was wondering if anyone had started working their way through the TouchDevelop Examples found here: https://www.microbit.co.uk/td/lessons Although the TouchDevelop ones definitely need some TLC themselves before they're unleashed on Teachers proper. I was considering doing so myself, in order to get up to speed with MicroPython on the MicroBit. Would it be useful to turn them into introductory resources for teachers and students to help get them up to speed, too? Or is a similar, parallel effort already under way? Cheers Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From ntoll at ntoll.org Fri Jan 29 03:16:22 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Fri, 29 Jan 2016 08:16:22 +0000 Subject: [Microbit-Python] Porting the TouchDevelop Examples to MicroPython In-Reply-To: References: Message-ID: <56AB1FD6.2000608@ntoll.org> Dave, You are truly a star among teachers..! Indeed, there are efforts to create resources for teachers and students, but not based upon the lessons that exist for TD and anyway, these are still in the planning stages. I'd like to convene an (online) meeting for people interested with these efforts. How's Monday evening looking for you..? I'm having a call with Yvonne Walker from CAS about this very sort of thing (we want to run a workshop for CAS master teachers in London soon). Care to join us (online)? That goes for anyone else... N. On 28/01/16 23:45, Dave Ames wrote: > Hi > > I was wondering if anyone had started working their way through the > TouchDevelop Examples found here: https://www.microbit.co.uk/td/lessons > Although the TouchDevelop ones definitely need some TLC themselves > before they're unleashed on Teachers proper. > > I was considering doing so myself, in order to get up to speed with > MicroPython on the MicroBit. Would it be useful to turn them into > introductory resources for teachers and students to help get them up to > speed, too? Or is a similar, parallel effort already under way? > > Cheers > Dave > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From david.john.ames at gmail.com Fri Jan 29 06:16:10 2016 From: david.john.ames at gmail.com (Dave Ames) Date: Fri, 29 Jan 2016 11:16:10 +0000 Subject: [Microbit-Python] Porting the TouchDevelop Examples to MicroPython In-Reply-To: <56AB1FD6.2000608@ntoll.org> References: <56AB1FD6.2000608@ntoll.org> Message-ID: Hi Nicholas On Monday evening, I'm probably at the Preston CAS Hub (playing with Microbits) then at the Preston Raspberry Jam both with Alan O'D. Dave On Fri, 29 Jan 2016 08:16 Nicholas H.Tollervey wrote: > Dave, > > You are truly a star among teachers..! > > Indeed, there are efforts to create resources for teachers and students, > but not based upon the lessons that exist for TD and anyway, these are > still in the planning stages. > > I'd like to convene an (online) meeting for people interested with these > efforts. How's Monday evening looking for you..? I'm having a call with > Yvonne Walker from CAS about this very sort of thing (we want to run a > workshop for CAS master teachers in London soon). Care to join us (online)? > > That goes for anyone else... > > N. > > On 28/01/16 23:45, Dave Ames wrote: > > Hi > > > > I was wondering if anyone had started working their way through the > > TouchDevelop Examples found here: https://www.microbit.co.uk/td/lessons > > Although the TouchDevelop ones definitely need some TLC themselves > > before they're unleashed on Teachers proper. > > > > I was considering doing so myself, in order to get up to speed with > > MicroPython on the MicroBit. Would it be useful to turn them into > > introductory resources for teachers and students to help get them up to > > speed, too? Or is a similar, parallel effort already under way? > > > > Cheers > > Dave > > > > > > _______________________________________________ > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From corinne at lilycat.co.uk Fri Jan 29 13:03:59 2016 From: corinne at lilycat.co.uk (Corinne Welsh) Date: Fri, 29 Jan 2016 18:03:59 +0000 Subject: [Microbit-Python] Porting the TouchDevelop Examples to MicroPython Message-ID: > Hi > > I was wondering if anyone had started working their way through the > TouchDevelop Examples found here: https://www.microbit.co.uk/td/lessons > Although the TouchDevelop ones definitely need some TLC themselves before > they're unleashed on Teachers proper. > > I was considering doing so myself, in order to get up to speed with > MicroPython on the MicroBit. Would it be useful to turn them into > introductory resources for teachers and students to help get them up to > speed, too? Or is a similar, parallel effort already under way? > > Cheers > Dave > -------------- next part -------------- > > Dave, > > You are truly a star among teachers..! > > Indeed, there are efforts to create resources for teachers and students, > but not based upon the lessons that exist for TD and anyway, these are > still in the planning stages. > > I'd like to convene an (online) meeting for people interested with these > efforts. How's Monday evening looking for you..? I'm having a call with > Yvonne Walker from CAS about this very sort of thing (we want to run a > workshop for CAS master teachers in London soon). Care to join us (online)? > > That goes for anyone else... > > N. > Hi I'm interested in joining with these plans. I go out to a (self-imposed) Django study session on Monday evenings, so not sure I can make the online meeting. But keen to keep up with the discussion. Corinne