From a.grandi at gmail.com Mon Feb 1 06:31:49 2016 From: a.grandi at gmail.com (a.grandi at gmail.com) Date: Mon, 1 Feb 2016 11:31:49 +0000 Subject: [Microbit-Python] FOSDEM slides Message-ID: Hi, I was at FOSDEM during the past weekend and at the end of the lightning talks there was a quick presentation of the MicroBit board from someone who I don't remember his name but I remember I asked him if he was subscribed to this mailing list. Hi! :) if you are reading, could you please post the slides somewhere? Unfortunately they're not on the FOSDEM Python track page https://fosdem.org/2016/schedule/track/python/ cheers -- Andrea Grandi - Software Engineer Website: https://www.andreagrandi.it Twitter: https://twitter.com/andreagrandi GitHub: https://github.com/andreagrandi PGP: 7238 74F6 886D 5994 323F 1781 8CFB 47AD C384 F0CC From ntoll at ntoll.org Mon Feb 1 07:05:05 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 1 Feb 2016 12:05:05 +0000 Subject: [Microbit-Python] FOSDEM slides In-Reply-To: References: Message-ID: <56AF49F1.9020203@ntoll.org> On 01/02/16 11:31, a.grandi at gmail.com wrote: > Hi, > > I was at FOSDEM during the past weekend and at the end of the > lightning talks there was a quick presentation of the MicroBit board > from someone who I don't remember his name but I remember I asked him > if he was subscribed to this mailing list. > > Hi! :) if you are reading, could you please post the slides somewhere? > Unfortunately they're not on the FOSDEM Python track page > https://fosdem.org/2016/schedule/track/python/ > > cheers > That'd be Marc Andre. ;-) 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 mal at egenix.com Mon Feb 1 07:40:43 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Mon, 1 Feb 2016 13:40:43 +0100 Subject: [Microbit-Python] FOSDEM slides In-Reply-To: <56AF49F1.9020203@ntoll.org> References: <56AF49F1.9020203@ntoll.org> Message-ID: <56AF524B.5020508@egenix.com> On 01.02.2016 13:05, Nicholas H.Tollervey wrote: > On 01/02/16 11:31, a.grandi at gmail.com wrote: >> Hi, >> >> I was at FOSDEM during the past weekend and at the end of the >> lightning talks there was a quick presentation of the MicroBit board >> from someone who I don't remember his name but I remember I asked him >> if he was subscribed to this mailing list. >> >> Hi! :) if you are reading, could you please post the slides somewhere? >> Unfortunately they're not on the FOSDEM Python track page >> https://fosdem.org/2016/schedule/track/python/ >> >> cheers >> > > That'd be Marc Andre. ;-) I'll post them later today :-) -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Feb 01 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 a.grandi at gmail.com Mon Feb 1 09:09:47 2016 From: a.grandi at gmail.com (a.grandi at gmail.com) Date: Mon, 1 Feb 2016 14:09:47 +0000 Subject: [Microbit-Python] FOSDEM slides In-Reply-To: <56AF524B.5020508@egenix.com> References: <56AF49F1.9020203@ntoll.org> <56AF524B.5020508@egenix.com> Message-ID: Thanks Marc Andre and pleased to have met you at FOSDEM :) Cheers On 1 February 2016 at 12:40, M.-A. Lemburg wrote: > On 01.02.2016 13:05, Nicholas H.Tollervey wrote: >> On 01/02/16 11:31, a.grandi at gmail.com wrote: >>> Hi, >>> >>> I was at FOSDEM during the past weekend and at the end of the >>> lightning talks there was a quick presentation of the MicroBit board >>> from someone who I don't remember his name but I remember I asked him >>> if he was subscribed to this mailing list. >>> >>> Hi! :) if you are reading, could you please post the slides somewhere? >>> Unfortunately they're not on the FOSDEM Python track page >>> https://fosdem.org/2016/schedule/track/python/ >>> >>> cheers >>> >> >> That'd be Marc Andre. ;-) > > I'll post them later today :-) > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Experts (#1, Feb 01 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 -- Andrea Grandi - Software Engineer Website: https://www.andreagrandi.it Twitter: https://twitter.com/andreagrandi GitHub: https://github.com/andreagrandi PGP: 7238 74F6 886D 5994 323F 1781 8CFB 47AD C384 F0CC From mal at egenix.com Mon Feb 1 13:07:25 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Mon, 1 Feb 2016 19:07:25 +0100 Subject: [Microbit-Python] FOSDEM slides In-Reply-To: References: <56AF49F1.9020203@ntoll.org> <56AF524B.5020508@egenix.com> Message-ID: <56AF9EDD.2030805@egenix.com> On 01.02.2016 15:09, a.grandi at gmail.com wrote: > Thanks Marc Andre and pleased to have met you at FOSDEM :) Thanks, Andrea. Pleased to have met you too :-) Here's the PDF with the slides: https://downloads.egenix.com/python/FOSDEM-2016-PythonDevRoom-MicroPython-on-the-BBC-Microbit-Lightning-Talk.pdf The video shown on the demo slide is here (along with a few others): https://youtube.com/malemburg/ and these are the scripts: https://github.com/malemburg/microbit-experiments One of these days, I'll write up my part of the microbit world-tour based on all this. At the moment, I'm looking into connecting an ESP8266 Wifi board to the microbit... will have some soldering to do :-) Cheers, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Feb 01 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/ > Cheers > > On 1 February 2016 at 12:40, M.-A. Lemburg wrote: >> On 01.02.2016 13:05, Nicholas H.Tollervey wrote: >>> On 01/02/16 11:31, a.grandi at gmail.com wrote: >>>> Hi, >>>> >>>> I was at FOSDEM during the past weekend and at the end of the >>>> lightning talks there was a quick presentation of the MicroBit board >>>> from someone who I don't remember his name but I remember I asked him >>>> if he was subscribed to this mailing list. >>>> >>>> Hi! :) if you are reading, could you please post the slides somewhere? >>>> Unfortunately they're not on the FOSDEM Python track page >>>> https://fosdem.org/2016/schedule/track/python/ >>>> >>>> cheers >>>> >>> >>> That'd be Marc Andre. ;-) >> >> I'll post them later today :-) >> >> -- >> Marc-Andre Lemburg >> eGenix.com >> >> Professional Python Services directly from the Experts (#1, Feb 01 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 russell at keith-magee.com Mon Feb 1 21:42:25 2016 From: russell at keith-magee.com (Russell Keith-Magee) Date: Tue, 2 Feb 2016 10:42:25 +0800 Subject: [Microbit-Python] Power specification for Micro:bit Message-ID: Hi all, Can anyone confirm the power requirements/restrictions for the JST PH socket on the Micro:bit? I know it?s nominally 3V, with button cells or a pair of AAA?s providing that power; but if I use a LiPoly battery such as this one: http://core-electronics.com.au/lithium-ion-polymer-battery-3-7v-500mah.html which will guarantee 3V, but may provide up to 4.7V depending on the charge in the battery - am I going to fry anything? Is the voltage regulator managing the 5V line from the USB connector also used for the battery input? Yours, Russ Magee %-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From damien.p.george at gmail.com Tue Feb 2 04:32:05 2016 From: damien.p.george at gmail.com (Damien George) Date: Tue, 2 Feb 2016 09:32:05 +0000 Subject: [Microbit-Python] Power specification for Micro:bit In-Reply-To: References: Message-ID: Hi Russell, As far as I am aware, the details of the power circuitry and supply options has not yet been made official/public. Best regards, Damien. On Tue, Feb 2, 2016 at 2:42 AM, Russell Keith-Magee wrote: > Hi all, > > Can anyone confirm the power requirements/restrictions for the JST PH socket > on the Micro:bit? > > I know it?s nominally 3V, with button cells or a pair of AAA?s providing > that power; but if I use a LiPoly battery such as this one: > > http://core-electronics.com.au/lithium-ion-polymer-battery-3-7v-500mah.html > > which will guarantee 3V, but may provide up to 4.7V depending on the charge > in the battery - am I going to fry anything? Is the voltage regulator > managing the 5V line from the USB connector also used for the battery input? > > Yours, > Russ Magee %-) > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > From mal at egenix.com Tue Feb 2 08:47:17 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Tue, 2 Feb 2016 14:47:17 +0100 Subject: [Microbit-Python] Power specification for Micro:bit In-Reply-To: References: Message-ID: <56B0B365.5090500@egenix.com> On 02.02.2016 03:42, Russell Keith-Magee wrote: > Hi all, > > Can anyone confirm the power requirements/restrictions for the JST PH > socket on the Micro:bit? > > I know it?s nominally 3V, with button cells or a pair of AAA?s providing > that power; but if I use a LiPoly battery such as this one: > > http://core-electronics.com.au/lithium-ion-polymer-battery-3-7v-500mah.html > > which will guarantee 3V, but may provide up to 4.7V depending on the charge > in the battery - am I going to fry anything? Is the voltage regulator > managing the 5V line from the USB connector also used for the battery input? When connecting a USB device to the MB, the battery pins in the connector and power pins on the board show a reading of 3.2-3.3V, so I guess that's what the board likes to run with. This board is very similar to the MB, so perhaps you could glean some infos from their specs: https://www.mbed.com/en/development/hardware/boards/nordic/nrf51822/ Their spec for the power supply is 1.8V - 3.6V (pages 8 and 9): https://www.nordicsemi.com/eng/nordic/download_resource/30462/1/12808762 AFAIK, Radomir can confirm that using 6V is definitely too much for the MB ;-)... https://microworldtour.github.io/microbit/mahiri.html -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Feb 02 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 Sun Feb 7 07:19:38 2016 From: nevil.hunt at hotmail.co.uk (Nevil Hunt) Date: Sun, 7 Feb 2016 12:19:38 +0000 Subject: [Microbit-Python] =?windows-1252?q?Microbit-Python_=93Simon_Says?= =?windows-1252?q?=94_Example_for_Kitronik_Inventor=92s_Kit?= Message-ID: Hi, First of all I?d like to thank Nicholas for the Micro-Python initiative and Andrew Mulholland (who I met at the BETT show and who showed me how to get going with Microbit-Python). I am a STEM Ambassador and I?m working with one of the micro:bit partner companies, Kitronik, helping to get their resources ready for the roll out of the micro:bit into schools. In particular I?ve been helping get their ?Inventor?s Kit? ready. The Inventor?s Kit allows the micro:bit to connect to a Breadboard then comes with various electronic components (switches, LEDs, buzzers, motors, pots, etc) to experiment with connecting electronics to the micro:bit. The booklet that comes with the Kit has 10 experiments along with the code to drive them. Four use ?Block? and six use ?Touch? but our plan is to publish many more on the web site (www.kitronik.co.uk/microbit) We would like some of these to use Java and some to use Python. As you might imagine, things are quite busy. I am now up and running with Microbit-Python but I have limited time to write the example code so I thought I?d see if anyone on this forum fancied having a go! The first one we have in mind is a ?Simon Says? game where the Breadboard is fitted with 4 push switches (A,B,C,D) and a buzzer (see attached). Using the 4 corner LEDs of the micro:bit as the A,B,C,D lights the game starts by illuminating one random corner of the display e.g. ?B? and playing the note ?B? on the buzzer via P0. The player then has match this by pressing switch ?B? which illuminates ?B? and plays the note ?B?. The game then illuminates ?B? plus one more random corner, e.g. ?D? while playing note ?D? on the buzzer. The player then has match this by pressing switches ?B? and ?D? in sequence. The game continues by adding another random letter to the sequence, e.g. ?B? ?D? ?A? then ?B? ?D? ?A? ?B? then ?B? ?D? ?A? ?B? ?C? etc with the score being the maximum length of sequence the player correctly repeats. The game ends when the player fails to match the sequence. So if you fancy having a go, post me the code and I will try it out. Since you are unlikely to have an Inventor?s Kit you could try writing a simpler 2 switch version of the game using the ?A? and ?B? buttons on the micro:bit. Regards, Nevil Hunt STEM Ambassador -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Kitronik_Inventors_Kit_SimonSays_CctDiagram.jpg Type: image/jpeg Size: 206339 bytes Desc: not available URL: From ntoll at ntoll.org Sun Feb 7 07:27:51 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Sun, 7 Feb 2016 12:27:51 +0000 Subject: [Microbit-Python] =?utf-8?q?Microbit-Python_=E2=80=9CSimon_Says?= =?utf-8?q?=E2=80=9D_Example_for_Kitronik_Inventor=E2=80=99s_Kit?= In-Reply-To: References: Message-ID: <56B73847.80802@ntoll.org> Hi Nevil, Just a quick correction: it's Damien George who should be getting all the thanks - he's the creator of MicroPython and has put in a huge amount of work on this project. Without Damien we wouldn't have Python on the micro:bit. N. On 07/02/16 12:19, Nevil Hunt wrote: > > > Hi, > > > > First of all I?d like to thank Nicholas for the Micro-Python initiative > and Andrew Mulholland (who I met at the BETT show and who showed me how > to get going with Microbit-Python). I am a STEM Ambassador and I?m > working with one of the micro:bit partner companies, Kitronik, helping > to get their resources ready for the roll out of the micro:bit into > schools. In particular I?ve been helping get their ?Inventor?s Kit? > ready. The Inventor?s Kit allows the micro:bit to connect to a > Breadboard then comes with various electronic components (switches, > LEDs, buzzers, motors, pots, etc) to experiment with connecting > electronics to the micro:bit. The booklet that comes with the Kit has 10 > experiments along with the code to drive them. Four use ?Block? and six > use ?Touch? but our plan is to publish many more on the web site > (www.kitronik.co.uk/microbit ) We > would like some of these to use Java and some to use Python. As you > might imagine, things are quite busy. I am now up and running with > Microbit-Python but I have limited time to write the example code so I > thought I?d see if anyone on this forum fancied having a go! > > > > The first one we have in mind is a ?Simon Says? game where the > Breadboard is fitted with 4 push switches (A,B,C,D) and a buzzer (see > attached). Using the 4 corner LEDs of the micro:bit as the A,B,C,D > lights the game starts by illuminating one random corner of the display > e.g. ?B? and playing the note ?B? on the buzzer via P0. The player then > has match this by pressing switch ?B? which illuminates ?B? and plays > the note ?B?. The game then illuminates ?B? plus one more random corner, > e.g. ?D? while playing note ?D? on the buzzer. The player then has match > this by pressing switches ?B? and ?D? in sequence. The game continues by > adding another random letter to the sequence, e.g. ?B? ?D? ?A? then ?B? > ?D? ?A? ?B? then ?B? ?D? ?A? ?B? ?C? etc with the score being the > maximum length of sequence the player correctly repeats. The game ends > when the player fails to match the sequence. > > > > So if you fancy having a go, post me the code and I will try it out. > Since you are unlikely to have an Inventor?s Kit you could try writing a > simpler 2 switch version of the game using the ?A? and ?B? buttons on > the micro:bit. > > > > Regards, > > > > Nevil Hunt > > STEM Ambassador > > > > _______________________________________________ > 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 mal at egenix.com Sun Feb 7 09:04:15 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Sun, 7 Feb 2016 15:04:15 +0100 Subject: [Microbit-Python] Microbit and Wifi In-Reply-To: <20160120212153.1d57ded0@ghostwheel> References: <569FBC88.4020608@egenix.com> <20160120184647.3a062e98@ghostwheel> <569FE5BE.5090806@egenix.com> <20160120212153.1d57ded0@ghostwheel> Message-ID: <56B74EDF.9050503@egenix.com> Just a bit of an update on my progress so far. Not much, but I'm slowly getting there... I've ordered an ESP8266, the ESP-12E variant to be exact (there are lots of variants available) and have soldered everything together. I then found that even the board now fits a breadboard, it needs two breadboards to connect cables, since it completely covers the breadboard. Next was trying to find some good documentation for the ESP8266. There are tons of documentation snippets on the net, but nothing really concise. The many different available variants of the ESP8266 don't make this easier. I figured out that in order to start the chip, you need to connect the chip enable pin to VCC as well. I then tried to connect it to the UART pins 0 and 1. Unfortunately, using the MicroPython REPL, you lose the console output once you switch on UART usage, so that's not a good way to run experiments. So I turned to a serial USB cable... not much success there either, since those typically run with RS232 voltages (+/- 3V-15V), but the ESP8266 can only handle 3.3V. I'll have to order a more suitable adapter which outputs only 3.3V. I found one based on the CP2102 chip, which appears to do exactly this. With this I should then also be able to flash the ESP8266 with updated firmware (or even MicroPython). I guess I could also use a RasPi for interfacing to the ESP8266, since the RasPi pins also use 3.3V UART levels: http://elinux.org/RPi_Low-level_peripherals While reading up on the ESP8266 I also started to wonder whether using the AT command interface is really such a good approach. A native program running on the ESP8266 as Radomir suggested may be better to simplify the connection to the Microbit. I guess the main use of the wifi connection would be to send data somewhere, rather than receiving data on the MB, so perhaps a simply client interface for the MB would be enough to get things going. On 20.01.2016 21:21, Radomir Dopieralski wrote: > 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, >>> >>> >>> >> > > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Feb 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 chris at chrisarndt.de Sun Feb 7 09:11:13 2016 From: chris at chrisarndt.de (Christopher Arndt) Date: Sun, 7 Feb 2016 15:11:13 +0100 Subject: [Microbit-Python] Microbit and Wifi In-Reply-To: <56B74EDF.9050503@egenix.com> References: <569FBC88.4020608@egenix.com> <20160120184647.3a062e98@ghostwheel> <569FE5BE.5090806@egenix.com> <20160120212153.1d57ded0@ghostwheel> <56B74EDF.9050503@egenix.com> Message-ID: <56B75081.1000208@chrisarndt.de> Am 07.02.2016 um 15:04 schrieb M.-A. Lemburg: > While reading up on the ESP8266 I also started to wonder whether > using the AT command interface is really such a good approach. > A native program running on the ESP8266 as Radomir suggested may > be better to simplify the connection to the Microbit. Until MicroPython for the esp8266 is ready, I suggest running NodeMCU on it. Much easier to work with than AT commands and Lua is a nice language too. Chris -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 979 bytes Desc: OpenPGP digital signature URL: From ntoll at ntoll.org Sun Feb 7 09:09:54 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Sun, 7 Feb 2016 14:09:54 +0000 Subject: [Microbit-Python] Microbit and Wifi In-Reply-To: <56B74EDF.9050503@egenix.com> References: <569FBC88.4020608@egenix.com> <20160120184647.3a062e98@ghostwheel> <569FE5BE.5090806@egenix.com> <20160120212153.1d57ded0@ghostwheel> <56B74EDF.9050503@egenix.com> Message-ID: <56B75032.3010201@ntoll.org> Marc Andre, Damien knows a lot about the ESP-8266 (viz. https://www.kickstarter.com/projects/214379695/micropython-on-the-esp8266-beautifully-easy-iot?ref=hero_thanks) or if *he* doesn't, then his collaborator Paul probably does. Glad to see you're having so much fun. I'm spending my Sunday fixing CSS bugs in the TouchDevelop editor when displayed in IE. I know what I'd rather be doing... In fact, I think I'd rather be sticking forks in my eyes... ;-) N. On 07/02/16 14:04, M.-A. Lemburg wrote: > Just a bit of an update on my progress so far. Not much, but > I'm slowly getting there... > > I've ordered an ESP8266, the ESP-12E variant to be exact (there > are lots of variants available) and have soldered everything > together. > > I then found that even the board now fits a breadboard, it > needs two breadboards to connect cables, since it completely > covers the breadboard. > > Next was trying to find some good documentation for the ESP8266. > There are tons of documentation snippets on the net, but nothing > really concise. The many different available variants of the ESP8266 > don't make this easier. > > I figured out that in order to start the chip, you need to > connect the chip enable pin to VCC as well. > > I then tried to connect it to the UART pins 0 and 1. Unfortunately, > using the MicroPython REPL, you lose the console output once > you switch on UART usage, so that's not a good way to run > experiments. > > So I turned to a serial USB cable... not much success there either, > since those typically run with RS232 voltages (+/- 3V-15V), but > the ESP8266 can only handle 3.3V. > > I'll have to order a more suitable adapter which outputs only 3.3V. > I found one based on the CP2102 chip, which appears to do exactly > this. With this I should then also be able to flash the > ESP8266 with updated firmware (or even MicroPython). > > I guess I could also use a RasPi for interfacing to the ESP8266, > since the RasPi pins also use 3.3V UART levels: > > http://elinux.org/RPi_Low-level_peripherals > > While reading up on the ESP8266 I also started to wonder whether > using the AT command interface is really such a good approach. > A native program running on the ESP8266 as Radomir suggested may > be better to simplify the connection to the Microbit. > > I guess the main use of the wifi connection would be to send > data somewhere, rather than receiving data on the MB, so perhaps > a simply client interface for the MB would be enough to get > things going. > > > On 20.01.2016 21:21, Radomir Dopieralski wrote: >> 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, >>>> >>>> >>>> >>> >> >> >> > -------------- 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 Sun Feb 7 09:17:40 2016 From: microbit at sheep.art.pl (Radomir Dopieralski) Date: Sun, 7 Feb 2016 15:17:40 +0100 Subject: [Microbit-Python] Microbit and Wifi In-Reply-To: <56B74EDF.9050503@egenix.com> References: <569FBC88.4020608@egenix.com> <20160120184647.3a062e98@ghostwheel> <569FE5BE.5090806@egenix.com> <20160120212153.1d57ded0@ghostwheel> <56B74EDF.9050503@egenix.com> Message-ID: <20160207151740.3adffcfb@ghostwheel> On Sun, 7 Feb 2016 15:04:15 +0100 "M.-A. Lemburg" wrote: > While reading up on the ESP8266 I also started to wonder whether > using the AT command interface is really such a good approach. > A native program running on the ESP8266 as Radomir suggested may > be better to simplify the connection to the Microbit. With a custom program, you could also connect it to the Micro:Bit over I?C or ISP interface, instead of UART, and thus not lose the REPL. -- Radomir Dopieralski -- Radomir Dopieralski From damien.p.george at gmail.com Sun Feb 7 18:10:07 2016 From: damien.p.george at gmail.com (Damien George) Date: Sun, 7 Feb 2016 23:10:07 +0000 Subject: [Microbit-Python] =?utf-8?q?Microbit-Python_=E2=80=9CSimon_Says?= =?utf-8?q?=E2=80=9D_Example_for_Kitronik_Inventor=E2=80=99s_Kit?= In-Reply-To: <56B73847.80802@ntoll.org> References: <56B73847.80802@ntoll.org> Message-ID: Hi Nevil, Does the inventor's kit have a proper speaker (not just a buzzer)? If so when we can be even more creative with MicroPython and play tunes and notes through it. Cheers, Damien. On Sun, Feb 7, 2016 at 12:27 PM, Nicholas H.Tollervey wrote: > Hi Nevil, > > Just a quick correction: it's Damien George who should be getting all > the thanks - he's the creator of MicroPython and has put in a huge > amount of work on this project. > > Without Damien we wouldn't have Python on the micro:bit. > > N. > > On 07/02/16 12:19, Nevil Hunt wrote: >> >> >> Hi, >> >> >> >> First of all I?d like to thank Nicholas for the Micro-Python initiative >> and Andrew Mulholland (who I met at the BETT show and who showed me how >> to get going with Microbit-Python). I am a STEM Ambassador and I?m >> working with one of the micro:bit partner companies, Kitronik, helping >> to get their resources ready for the roll out of the micro:bit into >> schools. In particular I?ve been helping get their ?Inventor?s Kit? >> ready. The Inventor?s Kit allows the micro:bit to connect to a >> Breadboard then comes with various electronic components (switches, >> LEDs, buzzers, motors, pots, etc) to experiment with connecting >> electronics to the micro:bit. The booklet that comes with the Kit has 10 >> experiments along with the code to drive them. Four use ?Block? and six >> use ?Touch? but our plan is to publish many more on the web site >> (www.kitronik.co.uk/microbit ) We >> would like some of these to use Java and some to use Python. As you >> might imagine, things are quite busy. I am now up and running with >> Microbit-Python but I have limited time to write the example code so I >> thought I?d see if anyone on this forum fancied having a go! >> >> >> >> The first one we have in mind is a ?Simon Says? game where the >> Breadboard is fitted with 4 push switches (A,B,C,D) and a buzzer (see >> attached). Using the 4 corner LEDs of the micro:bit as the A,B,C,D >> lights the game starts by illuminating one random corner of the display >> e.g. ?B? and playing the note ?B? on the buzzer via P0. The player then >> has match this by pressing switch ?B? which illuminates ?B? and plays >> the note ?B?. The game then illuminates ?B? plus one more random corner, >> e.g. ?D? while playing note ?D? on the buzzer. The player then has match >> this by pressing switches ?B? and ?D? in sequence. The game continues by >> adding another random letter to the sequence, e.g. ?B? ?D? ?A? then ?B? >> ?D? ?A? ?B? then ?B? ?D? ?A? ?B? ?C? etc with the score being the >> maximum length of sequence the player correctly repeats. The game ends >> when the player fails to match the sequence. >> >> >> >> So if you fancy having a go, post me the code and I will try it out. >> Since you are unlikely to have an Inventor?s Kit you could try writing a >> simpler 2 switch version of the game using the ?A? and ?B? buttons on >> the micro:bit. >> >> >> >> Regards, >> >> >> >> Nevil Hunt >> >> STEM Ambassador >> >> >> >> _______________________________________________ >> 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 ntoll at ntoll.org Sun Feb 7 19:16:53 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 8 Feb 2016 00:16:53 +0000 Subject: [Microbit-Python] Feedback on TouchDevelop editor help please... Message-ID: <56B7DE75.5020101@ntoll.org> Hi, https://microbit-test.pythonanywhere.com/help.html This is a *first* draft (so subject to significant revision) for the kids' help page relating to the browser based editor that sits in Microsoft's TouchDevelop platform (the "blessed" solution from the BBC). It's designed to appeal to 11yo kids and to only give the very basics about Python, MicroPython, the code editor and simple programming. If you're thinking "where's the tutorials and lessons?" then rest assured I have those in hand as you'll soon (hopefully) see. If you're thinking, "where's the link to python.org?" then be prepared for a half-hour lecture on the "eccentric" BBC "linking" policies that I have to meet. Honestly, buy me a beer, grab some pop-corn and enjoy the show when next you see me at a PyCon. I'm not precious about any of the content therein, so I'd welcome comments, constructive critique and ideas. If you want to create your own comics, knock yourself out here: http://pycomic.github.io/ (and buy Steve Hawkes a beer for his wonderful design work). Finally, many many many many thanks to Giles, Harry and the others at PythonAnywhere for making it super duper easy to host all this for free despite bureaucratic numberwang concerning hosting constraints (numberwang reference for those not in the UK: https://www.youtube.com/watch?v=qjOZtWZ56lc) On a happier note, I've squashed the remaining CSS related bugs in IE and Safari, made it all work in a nicer "responsive" way as well as worked around a rather nasty Safari based bug relating to the download of hex files. I spent a lot of today cross-browser testing and cursing. :-) All the best, 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 carlos.p.a.87 at gmail.com Sun Feb 7 19:23:36 2016 From: carlos.p.a.87 at gmail.com (Carlos P.A.) Date: Mon, 8 Feb 2016 00:23:36 +0000 Subject: [Microbit-Python] Feedback on TouchDevelop editor help please... In-Reply-To: <56B7DE75.5020101@ntoll.org> References: <56B7DE75.5020101@ntoll.org> Message-ID: Hi, Looking forward to test, however apart from the HTML nothing else is loading when I go to https://microbit-test.pythonanywhere.com/help.html , all images and css give me 404? Kind Regards, Carlos On 8 February 2016 at 00:16, Nicholas H.Tollervey wrote: > Hi, > > https://microbit-test.pythonanywhere.com/help.html > > This is a *first* draft (so subject to significant revision) for the > kids' help page relating to the browser based editor that sits in > Microsoft's TouchDevelop platform (the "blessed" solution from the BBC). > > It's designed to appeal to 11yo kids and to only give the very basics > about Python, MicroPython, the code editor and simple programming. If > you're thinking "where's the tutorials and lessons?" then rest assured I > have those in hand as you'll soon (hopefully) see. > > If you're thinking, "where's the link to python.org?" then be prepared > for a half-hour lecture on the "eccentric" BBC "linking" policies that I > have to meet. Honestly, buy me a beer, grab some pop-corn and enjoy the > show when next you see me at a PyCon. > > I'm not precious about any of the content therein, so I'd welcome > comments, constructive critique and ideas. If you want to create your > own comics, knock yourself out here: http://pycomic.github.io/ (and buy > Steve Hawkes a beer for his wonderful design work). > > Finally, many many many many thanks to Giles, Harry and the others at > PythonAnywhere for making it super duper easy to host all this for free > despite bureaucratic numberwang concerning hosting constraints > (numberwang reference for those not in the UK: > https://www.youtube.com/watch?v=qjOZtWZ56lc) > > On a happier note, I've squashed the remaining CSS related bugs in IE > and Safari, made it all work in a nicer "responsive" way as well as > worked around a rather nasty Safari based bug relating to the download > of hex files. I spent a lot of today cross-browser testing and cursing. > > :-) > > All the best, > > N. > > > > _______________________________________________ > 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 Feb 8 02:39:52 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 8 Feb 2016 07:39:52 +0000 Subject: [Microbit-Python] Feedback on TouchDevelop editor help please... In-Reply-To: References: <56B7DE75.5020101@ntoll.org> Message-ID: <56B84648.8030604@ntoll.org> It works for me..! Anyone else seeing this problem..? N. On 08/02/16 00:23, Carlos P.A. wrote: > Hi, > > Looking forward to test, however apart from the HTML nothing else is > loading when I go to https://microbit-test.pythonanywhere.com/help.html > , all images and css give me 404? > > Kind Regards, > Carlos > > On 8 February 2016 at 00:16, Nicholas H.Tollervey > wrote: > > Hi, > > https://microbit-test.pythonanywhere.com/help.html > > This is a *first* draft (so subject to significant revision) for the > kids' help page relating to the browser based editor that sits in > Microsoft's TouchDevelop platform (the "blessed" solution from the BBC). > > It's designed to appeal to 11yo kids and to only give the very basics > about Python, MicroPython, the code editor and simple programming. If > you're thinking "where's the tutorials and lessons?" then rest assured I > have those in hand as you'll soon (hopefully) see. > > If you're thinking, "where's the link to python.org > ?" then be prepared > for a half-hour lecture on the "eccentric" BBC "linking" policies that I > have to meet. Honestly, buy me a beer, grab some pop-corn and enjoy the > show when next you see me at a PyCon. > > I'm not precious about any of the content therein, so I'd welcome > comments, constructive critique and ideas. If you want to create your > own comics, knock yourself out here: http://pycomic.github.io/ (and buy > Steve Hawkes a beer for his wonderful design work). > > Finally, many many many many thanks to Giles, Harry and the others at > PythonAnywhere for making it super duper easy to host all this for free > despite bureaucratic numberwang concerning hosting constraints > (numberwang reference for those not in the UK: > https://www.youtube.com/watch?v=qjOZtWZ56lc) > > On a happier note, I've squashed the remaining CSS related bugs in IE > and Safari, made it all work in a nicer "responsive" way as well as > worked around a rather nasty Safari based bug relating to the download > of hex files. I spent a lot of today cross-browser testing and cursing. > > :-) > > All the best, > > N. > > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > > > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: From carlos.p.a.87 at gmail.com Mon Feb 8 03:38:13 2016 From: carlos.p.a.87 at gmail.com (Carlos P.A.) Date: Mon, 8 Feb 2016 08:38:13 +0000 Subject: [Microbit-Python] Feedback on TouchDevelop editor help please... In-Reply-To: <56B84648.8030604@ntoll.org> References: <56B7DE75.5020101@ntoll.org> <56B84648.8030604@ntoll.org> Message-ID: It seems to be working now in the morning, I'll have a proper look after work :) Not quite sure what happened last night, tried it from my computer and my phone through mobile internet. Regards, Carlos On 8 February 2016 at 07:39, Nicholas H.Tollervey wrote: > It works for me..! > > Anyone else seeing this problem..? > > N. > > On 08/02/16 00:23, Carlos P.A. wrote: > > Hi, > > > > Looking forward to test, however apart from the HTML nothing else is > > loading when I go to https://microbit-test.pythonanywhere.com/help.html > > , all images and css give me 404? > > > > Kind Regards, > > Carlos > > > > On 8 February 2016 at 00:16, Nicholas H.Tollervey > > wrote: > > > > Hi, > > > > https://microbit-test.pythonanywhere.com/help.html > > > > This is a *first* draft (so subject to significant revision) for the > > kids' help page relating to the browser based editor that sits in > > Microsoft's TouchDevelop platform (the "blessed" solution from the > BBC). > > > > It's designed to appeal to 11yo kids and to only give the very basics > > about Python, MicroPython, the code editor and simple programming. If > > you're thinking "where's the tutorials and lessons?" then rest > assured I > > have those in hand as you'll soon (hopefully) see. > > > > If you're thinking, "where's the link to python.org > > ?" then be prepared > > for a half-hour lecture on the "eccentric" BBC "linking" policies > that I > > have to meet. Honestly, buy me a beer, grab some pop-corn and enjoy > the > > show when next you see me at a PyCon. > > > > I'm not precious about any of the content therein, so I'd welcome > > comments, constructive critique and ideas. If you want to create your > > own comics, knock yourself out here: http://pycomic.github.io/ (and > buy > > Steve Hawkes a beer for his wonderful design work). > > > > Finally, many many many many thanks to Giles, Harry and the others at > > PythonAnywhere for making it super duper easy to host all this for > free > > despite bureaucratic numberwang concerning hosting constraints > > (numberwang reference for those not in the UK: > > https://www.youtube.com/watch?v=qjOZtWZ56lc) > > > > On a happier note, I've squashed the remaining CSS related bugs in IE > > and Safari, made it all work in a nicer "responsive" way as well as > > worked around a rather nasty Safari based bug relating to the > download > > of hex files. I spent a lot of today cross-browser testing and > cursing. > > > > :-) > > > > All the best, > > > > N. > > > > > > > > _______________________________________________ > > Microbit mailing list > > Microbit at python.org > > https://mail.python.org/mailman/listinfo/microbit > > > > > > > > > > _______________________________________________ > > Microbit mailing list > > Microbit at python.org > > https://mail.python.org/mailman/listinfo/microbit > > > > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlos.p.a.87 at gmail.com Mon Feb 8 04:01:07 2016 From: carlos.p.a.87 at gmail.com (Carlos P.A.) Date: Mon, 8 Feb 2016 09:01:07 +0000 Subject: [Microbit-Python] Feedback on TouchDevelop editor help please... In-Reply-To: References: <56B7DE75.5020101@ntoll.org> <56B84648.8030604@ntoll.org> Message-ID: Quick one, I've noticed the xkcd license is listed at the bottom of the page, but there is no mention of Simone's robot gif. Regards, Carlos On 8 Feb 2016 08:38, "Carlos P.A." wrote: > It seems to be working now in the morning, I'll have a proper look after > work :) Not quite sure what happened last night, tried it from my computer > and my phone through mobile internet. > > Regards, > Carlos > > On 8 February 2016 at 07:39, Nicholas H.Tollervey wrote: > >> It works for me..! >> >> Anyone else seeing this problem..? >> >> N. >> >> On 08/02/16 00:23, Carlos P.A. wrote: >> > Hi, >> > >> > Looking forward to test, however apart from the HTML nothing else is >> > loading when I go to https://microbit-test.pythonanywhere.com/help.html >> > , all images and css give me 404? >> > >> > Kind Regards, >> > Carlos >> > >> > On 8 February 2016 at 00:16, Nicholas H.Tollervey > > > wrote: >> > >> > Hi, >> > >> > https://microbit-test.pythonanywhere.com/help.html >> > >> > This is a *first* draft (so subject to significant revision) for the >> > kids' help page relating to the browser based editor that sits in >> > Microsoft's TouchDevelop platform (the "blessed" solution from the >> BBC). >> > >> > It's designed to appeal to 11yo kids and to only give the very >> basics >> > about Python, MicroPython, the code editor and simple programming. >> If >> > you're thinking "where's the tutorials and lessons?" then rest >> assured I >> > have those in hand as you'll soon (hopefully) see. >> > >> > If you're thinking, "where's the link to python.org >> > ?" then be prepared >> > for a half-hour lecture on the "eccentric" BBC "linking" policies >> that I >> > have to meet. Honestly, buy me a beer, grab some pop-corn and enjoy >> the >> > show when next you see me at a PyCon. >> > >> > I'm not precious about any of the content therein, so I'd welcome >> > comments, constructive critique and ideas. If you want to create >> your >> > own comics, knock yourself out here: http://pycomic.github.io/ >> (and buy >> > Steve Hawkes a beer for his wonderful design work). >> > >> > Finally, many many many many thanks to Giles, Harry and the others >> at >> > PythonAnywhere for making it super duper easy to host all this for >> free >> > despite bureaucratic numberwang concerning hosting constraints >> > (numberwang reference for those not in the UK: >> > https://www.youtube.com/watch?v=qjOZtWZ56lc) >> > >> > On a happier note, I've squashed the remaining CSS related bugs in >> IE >> > and Safari, made it all work in a nicer "responsive" way as well as >> > worked around a rather nasty Safari based bug relating to the >> download >> > of hex files. I spent a lot of today cross-browser testing and >> cursing. >> > >> > :-) >> > >> > All the best, >> > >> > N. >> > >> > >> > >> > _______________________________________________ >> > Microbit mailing list >> > Microbit at python.org >> > https://mail.python.org/mailman/listinfo/microbit >> > >> > >> > >> > >> > _______________________________________________ >> > Microbit mailing list >> > Microbit at python.org >> > https://mail.python.org/mailman/listinfo/microbit >> > >> >> >> >> _______________________________________________ >> 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 Feb 8 04:16:39 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 8 Feb 2016 09:16:39 +0000 Subject: [Microbit-Python] Feedback on TouchDevelop editor help please... In-Reply-To: References: <56B7DE75.5020101@ntoll.org> <56B84648.8030604@ntoll.org> Message-ID: <56B85CF7.9050202@ntoll.org> On 08/02/16 09:01, Carlos P.A. wrote: > Quick one, I've noticed the xkcd license is listed at the bottom of the > page, but there is no mention of Simone's robot gif. > > Regards, > Carlos > Dammit... yes... The origin is here: http://motherboard.vice.com/read/how-to-build-a-robot-that-will-feed-you-breakfast but I can't see if this is liberally licensed enough. :-( Thoughts..? 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 carlos.p.a.87 at gmail.com Mon Feb 8 04:36:05 2016 From: carlos.p.a.87 at gmail.com (Carlos P.A.) Date: Mon, 08 Feb 2016 09:36:05 +0000 Subject: [Microbit-Python] Feedback on TouchDevelop editor help please... In-Reply-To: <56B85CF7.9050202@ntoll.org> References: <56B7DE75.5020101@ntoll.org> <56B84648.8030604@ntoll.org> <56B85CF7.9050202@ntoll.org> Message-ID: I think the same gif is posted in her website (easy to find Googling her name from the article), maybe there is a license there or she could be easily contacted for clarification. Regards, Carlos On Mon, 8 Feb 2016 09:16 Nicholas H.Tollervey wrote: > On 08/02/16 09:01, Carlos P.A. wrote: > > Quick one, I've noticed the xkcd license is listed at the bottom of the > > page, but there is no mention of Simone's robot gif. > > > > Regards, > > Carlos > > > > Dammit... yes... The origin is here: > > http://motherboard.vice.com/read/how-to-build-a-robot-that-will-feed-you-breakfast > but I can't see if this is liberally licensed enough. :-( > > Thoughts..? > > N. > > > _______________________________________________ > 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 Mon Feb 8 07:38:30 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Mon, 8 Feb 2016 13:38:30 +0100 Subject: [Microbit-Python] Microbit and Wifi In-Reply-To: <20160207151740.3adffcfb@ghostwheel> References: <569FBC88.4020608@egenix.com> <20160120184647.3a062e98@ghostwheel> <569FE5BE.5090806@egenix.com> <20160120212153.1d57ded0@ghostwheel> <56B74EDF.9050503@egenix.com> <20160207151740.3adffcfb@ghostwheel> Message-ID: <56B88C46.5060005@egenix.com> On 07.02.2016 15:17, Radomir Dopieralski wrote: > On Sun, 7 Feb 2016 15:04:15 +0100 > "M.-A. Lemburg" wrote: > >> While reading up on the ESP8266 I also started to wonder whether >> using the AT command interface is really such a good approach. >> A native program running on the ESP8266 as Radomir suggested may >> be better to simplify the connection to the Microbit. > > With a custom program, you could also connect it to the Micro:Bit over > I?C or ISP interface, instead of UART, and thus not lose the REPL. I'm afraid, I have no idea how to program I2C or ISP interfaces, so those are not really alternatives. :-) On 07.02.2016 15:11, Christopher Arndt wrote: > Until MicroPython for the esp8266 is ready, I suggest running NodeMCU on > it. Much easier to work with than AT commands and Lua is a nice language > too. I'll see how that goes. I'm more familiar with regular C than LUA, so if the ESP8266 C SDK works out fine, then going straight for C is likely the better option for me. Cheers, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Feb 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 naomi.ceder at gmail.com Mon Feb 8 08:57:54 2016 From: naomi.ceder at gmail.com (Naomi Ceder) Date: Mon, 8 Feb 2016 07:57:54 -0600 Subject: [Microbit-Python] Feedback on TouchDevelop editor help please... In-Reply-To: References: <56B7DE75.5020101@ntoll.org> <56B84648.8030604@ntoll.org> <56B85CF7.9050202@ntoll.org> Message-ID: Great stuff! It worked fine for me first time. One usability point. The text font seems pretty small. I know that 11 year olds don't need a huge font, but it strikes me as tiny enough to be off-putting. JMOH. Cheers, Naomi On 8 February 2016 at 03:36, Carlos P.A. wrote: > I think the same gif is posted in her website (easy to find Googling her > name from the article), maybe there is a license there or she could be > easily contacted for clarification. > > Regards, > Carlos > > On Mon, 8 Feb 2016 09:16 Nicholas H.Tollervey wrote: > >> On 08/02/16 09:01, Carlos P.A. wrote: >> > Quick one, I've noticed the xkcd license is listed at the bottom of the >> > page, but there is no mention of Simone's robot gif. >> > >> > Regards, >> > Carlos >> > >> >> Dammit... yes... The origin is here: >> >> http://motherboard.vice.com/read/how-to-build-a-robot-that-will-feed-you-breakfast >> but I can't see if this is liberally licensed enough. :-( >> >> Thoughts..? >> >> N. >> >> >> _______________________________________________ >> Microbit mailing list >> Microbit at python.org >> https://mail.python.org/mailman/listinfo/microbit >> > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > > -- Naomi Ceder https://plus.google.com/u/0/111396744045017339164/about -------------- next part -------------- An HTML attachment was scrubbed... URL: From carles at pina.cat Mon Feb 8 09:33:45 2016 From: carles at pina.cat (Carles Pina i Estany) Date: Mon, 8 Feb 2016 14:33:45 +0000 Subject: [Microbit-Python] Feedback on TouchDevelop editor help please... In-Reply-To: References: <56B7DE75.5020101@ntoll.org> <56B84648.8030604@ntoll.org> <56B85CF7.9050202@ntoll.org> Message-ID: <20160208143345.GA31656@pina.cat> Hi, On Feb/08/2016, Naomi Ceder wrote: > One usability point. The text font seems pretty small. I know that 11 year > olds don't need a huge font, but it strikes me as tiny enough to be > off-putting. JMOH. Big fonts encourage pair programming :-) (I have no data to support this...) > > Cheers, > Naomi > > On 8 February 2016 at 03:36, Carlos P.A. wrote: > > > I think the same gif is posted in her website (easy to find Googling her > > name from the article), maybe there is a license there or she could be > > easily contacted for clarification. > > > > Regards, > > Carlos > > > > On Mon, 8 Feb 2016 09:16 Nicholas H.Tollervey wrote: > > > >> On 08/02/16 09:01, Carlos P.A. wrote: > >> > Quick one, I've noticed the xkcd license is listed at the bottom of the > >> > page, but there is no mention of Simone's robot gif. > >> > > >> > Regards, > >> > Carlos > >> > > >> > >> Dammit... yes... The origin is here: > >> > >> http://motherboard.vice.com/read/how-to-build-a-robot-that-will-feed-you-breakfast > >> but I can't see if this is liberally licensed enough. :-( > >> > >> Thoughts..? > >> > >> N. > >> > >> > >> _______________________________________________ > >> Microbit mailing list > >> Microbit at python.org > >> https://mail.python.org/mailman/listinfo/microbit > >> > > > > _______________________________________________ > > Microbit mailing list > > Microbit at python.org > > https://mail.python.org/mailman/listinfo/microbit > > > > > > > -- > Naomi Ceder > https://plus.google.com/u/0/111396744045017339164/about > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit -- Carles Pina i Estany Web: http://pinux.info || Blog: http://pintant.cat GPG Key 0x8CD5C157 From nevil.hunt at hotmail.co.uk Mon Feb 8 11:10:35 2016 From: nevil.hunt at hotmail.co.uk (Nevil Hunt) Date: Mon, 8 Feb 2016 16:10:35 +0000 Subject: [Microbit-Python] =?windows-1252?q?Microbit-Python_=93Simon_Says?= =?windows-1252?q?=94_Example_for_Kitronik_Inventor=92s_Kit?= In-Reply-To: References: , <56B73847.80802@ntoll.org>, Message-ID: Hi Damien, The Inventor's Kit comes with a Piezo Buzzer since as it can be driven directly from the P0 output pin. A proper 8 ohm speaker needs an amp chip to drive it and as far as that is concerned watch this space! Looking on the 'scope, when I generate a note from Block it generates more-or-less a square wave. Do you have the ability to generate proper tunes using micro python? Nicholas said there were memory limitations in playing .wav files like you can using Python on the Raspberry Pi. If you have anything that works using micro python I would quite like to give it a go! Regards, Nevil > Date: Sun, 7 Feb 2016 23:10:07 +0000 > From: damien.p.george at gmail.com > To: microbit at python.org > Subject: Re: [Microbit-Python] Microbit-Python ?Simon Says? Example for Kitronik Inventor?s Kit > > Hi Nevil, > > Does the inventor's kit have a proper speaker (not just a buzzer)? If > so when we can be even more creative with MicroPython and play tunes > and notes through it. > > Cheers, > Damien. > > > On Sun, Feb 7, 2016 at 12:27 PM, Nicholas H.Tollervey wrote: > > Hi Nevil, > > > > Just a quick correction: it's Damien George who should be getting all > > the thanks - he's the creator of MicroPython and has put in a huge > > amount of work on this project. > > > > Without Damien we wouldn't have Python on the micro:bit. > > > > N. > > > > On 07/02/16 12:19, Nevil Hunt wrote: > >> > >> > >> Hi, > >> > >> > >> > >> First of all I?d like to thank Nicholas for the Micro-Python initiative > >> and Andrew Mulholland (who I met at the BETT show and who showed me how > >> to get going with Microbit-Python). I am a STEM Ambassador and I?m > >> working with one of the micro:bit partner companies, Kitronik, helping > >> to get their resources ready for the roll out of the micro:bit into > >> schools. In particular I?ve been helping get their ?Inventor?s Kit? > >> ready. The Inventor?s Kit allows the micro:bit to connect to a > >> Breadboard then comes with various electronic components (switches, > >> LEDs, buzzers, motors, pots, etc) to experiment with connecting > >> electronics to the micro:bit. The booklet that comes with the Kit has 10 > >> experiments along with the code to drive them. Four use ?Block? and six > >> use ?Touch? but our plan is to publish many more on the web site > >> (www.kitronik.co.uk/microbit ) We > >> would like some of these to use Java and some to use Python. As you > >> might imagine, things are quite busy. I am now up and running with > >> Microbit-Python but I have limited time to write the example code so I > >> thought I?d see if anyone on this forum fancied having a go! > >> > >> > >> > >> The first one we have in mind is a ?Simon Says? game where the > >> Breadboard is fitted with 4 push switches (A,B,C,D) and a buzzer (see > >> attached). Using the 4 corner LEDs of the micro:bit as the A,B,C,D > >> lights the game starts by illuminating one random corner of the display > >> e.g. ?B? and playing the note ?B? on the buzzer via P0. The player then > >> has match this by pressing switch ?B? which illuminates ?B? and plays > >> the note ?B?. The game then illuminates ?B? plus one more random corner, > >> e.g. ?D? while playing note ?D? on the buzzer. The player then has match > >> this by pressing switches ?B? and ?D? in sequence. The game continues by > >> adding another random letter to the sequence, e.g. ?B? ?D? ?A? then ?B? > >> ?D? ?A? ?B? then ?B? ?D? ?A? ?B? ?C? etc with the score being the > >> maximum length of sequence the player correctly repeats. The game ends > >> when the player fails to match the sequence. > >> > >> > >> > >> So if you fancy having a go, post me the code and I will try it out. > >> Since you are unlikely to have an Inventor?s Kit you could try writing a > >> simpler 2 switch version of the game using the ?A? and ?B? buttons on > >> the micro:bit. > >> > >> > >> > >> Regards, > >> > >> > >> > >> Nevil Hunt > >> > >> STEM Ambassador > >> > >> > >> > >> _______________________________________________ > >> 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 > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at thinkingbinaries.com Mon Feb 8 12:44:36 2016 From: david at thinkingbinaries.com (David Whale) Date: Mon, 8 Feb 2016 17:44:36 +0000 Subject: [Microbit-Python] =?utf-8?q?Microbit-Python_=E2=80=9CSimon_Says?= =?utf-8?q?=E2=80=9D_Example_for_Kitronik_Inventor=E2=80=99s_Kit?= In-Reply-To: References: <56B73847.80802@ntoll.org> Message-ID: I just use any old powered bluetooth speaker that has a 3.5mm aux input (hence the amp is onboard), and these are really loud! D On 8 February 2016 at 16:10, Nevil Hunt wrote: > Hi Damien, > > The Inventor's Kit comes with a Piezo Buzzer since as it can be driven > directly from the P0 output pin. > A proper 8 ohm speaker needs an amp chip to drive it and as far as that is > concerned watch this space! > Looking on the 'scope, when I generate a note from Block it generates > more-or-less a square wave. Do you have the ability to generate proper > tunes using micro python? > Nicholas said there were memory limitations in playing .wav files like you > can using Python on the Raspberry Pi. > If you have anything that works using micro python I would quite like to > give it a go! > > Regards, > > Nevil > > > Date: Sun, 7 Feb 2016 23:10:07 +0000 > > From: damien.p.george at gmail.com > > To: microbit at python.org > > Subject: Re: [Microbit-Python] Microbit-Python ?Simon Says? Example for > Kitronik Inventor?s Kit > > > > > Hi Nevil, > > > > Does the inventor's kit have a proper speaker (not just a buzzer)? If > > so when we can be even more creative with MicroPython and play tunes > > and notes through it. > > > > Cheers, > > Damien. > > > > > > On Sun, Feb 7, 2016 at 12:27 PM, Nicholas H.Tollervey > wrote: > > > Hi Nevil, > > > > > > Just a quick correction: it's Damien George who should be getting all > > > the thanks - he's the creator of MicroPython and has put in a huge > > > amount of work on this project. > > > > > > Without Damien we wouldn't have Python on the micro:bit. > > > > > > N. > > > > > > On 07/02/16 12:19, Nevil Hunt wrote: > > >> > > >> > > >> Hi, > > >> > > >> > > >> > > >> First of all I?d like to thank Nicholas for the Micro-Python > initiative > > >> and Andrew Mulholland (who I met at the BETT show and who showed me > how > > >> to get going with Microbit-Python). I am a STEM Ambassador and I?m > > >> working with one of the micro:bit partner companies, Kitronik, helping > > >> to get their resources ready for the roll out of the micro:bit into > > >> schools. In particular I?ve been helping get their ?Inventor?s Kit? > > >> ready. The Inventor?s Kit allows the micro:bit to connect to a > > >> Breadboard then comes with various electronic components (switches, > > >> LEDs, buzzers, motors, pots, etc) to experiment with connecting > > >> electronics to the micro:bit. The booklet that comes with the Kit has > 10 > > >> experiments along with the code to drive them. Four use ?Block? and > six > > >> use ?Touch? but our plan is to publish many more on the web site > > >> (www.kitronik.co.uk/microbit ) We > > >> would like some of these to use Java and some to use Python. As you > > >> might imagine, things are quite busy. I am now up and running with > > >> Microbit-Python but I have limited time to write the example code so I > > >> thought I?d see if anyone on this forum fancied having a go! > > >> > > >> > > >> > > >> The first one we have in mind is a ?Simon Says? game where the > > >> Breadboard is fitted with 4 push switches (A,B,C,D) and a buzzer (see > > >> attached). Using the 4 corner LEDs of the micro:bit as the A,B,C,D > > >> lights the game starts by illuminating one random corner of the > display > > >> e.g. ?B? and playing the note ?B? on the buzzer via P0. The player > then > > >> has match this by pressing switch ?B? which illuminates ?B? and plays > > >> the note ?B?. The game then illuminates ?B? plus one more random > corner, > > >> e.g. ?D? while playing note ?D? on the buzzer. The player then has > match > > >> this by pressing switches ?B? and ?D? in sequence. The game continues > by > > >> adding another random letter to the sequence, e.g. ?B? ?D? ?A? then > ?B? > > >> ?D? ?A? ?B? then ?B? ?D? ?A? ?B? ?C? etc with the score being the > > >> maximum length of sequence the player correctly repeats. The game ends > > >> when the player fails to match the sequence. > > >> > > >> > > >> > > >> So if you fancy having a go, post me the code and I will try it out. > > >> Since you are unlikely to have an Inventor?s Kit you could try > writing a > > >> simpler 2 switch version of the game using the ?A? and ?B? buttons on > > >> the micro:bit. > > >> > > >> > > >> > > >> Regards, > > >> > > >> > > >> > > >> Nevil Hunt > > >> > > >> STEM Ambassador > > >> > > >> > > >> > > >> _______________________________________________ > > >> 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 > > > > > _______________________________________________ > > 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 ntoll at ntoll.org Mon Feb 8 15:02:26 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 8 Feb 2016 20:02:26 +0000 Subject: [Microbit-Python] =?utf-8?q?Microbit-Python_=E2=80=9CSimon_Says?= =?utf-8?q?=E2=80=9D_Example_for_Kitronik_Inventor=E2=80=99s_Kit?= In-Reply-To: References: <56B73847.80802@ntoll.org> Message-ID: <56B8F452.8000102@ntoll.org> Nevil, We have a whole music module... See: http://microbit-micropython.readthedocs.org/en/latest/music.html :-) Happy to answer questions. N. On 08/02/16 16:10, Nevil Hunt wrote: > Hi Damien, > > The Inventor's Kit comes with a Piezo Buzzer since as it can be driven > directly from the P0 output pin. > A proper 8 ohm speaker needs an amp chip to drive it and as far as that > is concerned watch this space! > Looking on the 'scope, when I generate a note from Block it generates > more-or-less a square wave. Do you have the ability to generate proper > tunes using micro python? > Nicholas said there were memory limitations in playing .wav files > like you can using Python on the Raspberry Pi. > If you have anything that works using micro python I would quite like to > give it a go! > > Regards, > > Nevil > >> Date: Sun, 7 Feb 2016 23:10:07 +0000 >> From: damien.p.george at gmail.com >> To: microbit at python.org >> Subject: Re: [Microbit-Python] Microbit-Python ?Simon Says? Example > for Kitronik Inventor?s Kit >> >> Hi Nevil, >> >> Does the inventor's kit have a proper speaker (not just a buzzer)? If >> so when we can be even more creative with MicroPython and play tunes >> and notes through it. >> >> Cheers, >> Damien. >> >> >> On Sun, Feb 7, 2016 at 12:27 PM, Nicholas H.Tollervey > wrote: >> > Hi Nevil, >> > >> > Just a quick correction: it's Damien George who should be getting all >> > the thanks - he's the creator of MicroPython and has put in a huge >> > amount of work on this project. >> > >> > Without Damien we wouldn't have Python on the micro:bit. >> > >> > N. >> > >> > On 07/02/16 12:19, Nevil Hunt wrote: >> >> >> >> >> >> Hi, >> >> >> >> >> >> >> >> First of all I?d like to thank Nicholas for the Micro-Python initiative >> >> and Andrew Mulholland (who I met at the BETT show and who showed me how >> >> to get going with Microbit-Python). I am a STEM Ambassador and I?m >> >> working with one of the micro:bit partner companies, Kitronik, helping >> >> to get their resources ready for the roll out of the micro:bit into >> >> schools. In particular I?ve been helping get their ?Inventor?s Kit? >> >> ready. The Inventor?s Kit allows the micro:bit to connect to a >> >> Breadboard then comes with various electronic components (switches, >> >> LEDs, buzzers, motors, pots, etc) to experiment with connecting >> >> electronics to the micro:bit. The booklet that comes with the Kit > has 10 >> >> experiments along with the code to drive them. Four use ?Block? and six >> >> use ?Touch? but our plan is to publish many more on the web site >> >> (www.kitronik.co.uk/microbit ) We >> >> would like some of these to use Java and some to use Python. As you >> >> might imagine, things are quite busy. I am now up and running with >> >> Microbit-Python but I have limited time to write the example code so I >> >> thought I?d see if anyone on this forum fancied having a go! >> >> >> >> >> >> >> >> The first one we have in mind is a ?Simon Says? game where the >> >> Breadboard is fitted with 4 push switches (A,B,C,D) and a buzzer (see >> >> attached). Using the 4 corner LEDs of the micro:bit as the A,B,C,D >> >> lights the game starts by illuminating one random corner of the display >> >> e.g. ?B? and playing the note ?B? on the buzzer via P0. The player then >> >> has match this by pressing switch ?B? which illuminates ?B? and plays >> >> the note ?B?. The game then illuminates ?B? plus one more random > corner, >> >> e.g. ?D? while playing note ?D? on the buzzer. The player then has > match >> >> this by pressing switches ?B? and ?D? in sequence. The game > continues by >> >> adding another random letter to the sequence, e.g. ?B? ?D? ?A? then ?B? >> >> ?D? ?A? ?B? then ?B? ?D? ?A? ?B? ?C? etc with the score being the >> >> maximum length of sequence the player correctly repeats. The game ends >> >> when the player fails to match the sequence. >> >> >> >> >> >> >> >> So if you fancy having a go, post me the code and I will try it out. >> >> Since you are unlikely to have an Inventor?s Kit you could try > writing a >> >> simpler 2 switch version of the game using the ?A? and ?B? buttons on >> >> the micro:bit. >> >> >> >> >> >> >> >> Regards, >> >> >> >> >> >> >> >> Nevil Hunt >> >> >> >> STEM Ambassador >> >> >> >> >> >> >> >> _______________________________________________ >> >> 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 >> > >> _______________________________________________ >> 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 ntoll at ntoll.org Tue Feb 9 11:47:17 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Tue, 9 Feb 2016 16:47:17 +0000 Subject: [Microbit-Python] uArm with uBit Message-ID: <56BA1815.1000505@ntoll.org> For those makers among you... anyone got access to one of these beauties..? https://www.kickstarter.com/projects/ufactory/uarm-put-a-miniature-industrial-robot-arm-on-your?ref=live The name fits..? But will a micro:bit..? :-) 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 microbit at sheep.art.pl Tue Feb 9 11:52:18 2016 From: microbit at sheep.art.pl (Radomir Dopieralski) Date: Tue, 9 Feb 2016 17:52:18 +0100 Subject: [Microbit-Python] uArm with uBit In-Reply-To: <56BA1815.1000505@ntoll.org> References: <56BA1815.1000505@ntoll.org> Message-ID: <20160209175218.68b86f1d@ghostwheel> On Tue, 9 Feb 2016 16:47:17 +0000 "Nicholas H.Tollervey" wrote: > For those makers among you... anyone got access to one of these > beauties..? > > https://www.kickstarter.com/projects/ufactory/uarm-put-a-miniature-industrial-robot-arm-on-your?ref=live > > The name fits..? But will a micro:bit..? I have a MeArm sitting on the shelf and waiting for trimming the servos and programming, and somehow I never have the time to do it. I suppose using micro:bit would be nice, but I would need more than three pins -- it has four servos. I'm still waiting for that PCB I made as a breakout for it, when it arrives I will give it a try. You should be able to easily control the servos with the same code as I used for micro:bot and micro:bob. -- Radomir Dopieralski From sparks.m at gmail.com Tue Feb 9 12:02:46 2016 From: sparks.m at gmail.com (Michael) Date: Tue, 9 Feb 2016 17:02:46 +0000 Subject: [Microbit-Python] uArm with uBit In-Reply-To: <56BA1815.1000505@ntoll.org> References: <56BA1815.1000505@ntoll.org> Message-ID: There's more detail here -- http://store.ufactory.cc/uarm-metal/ https://ufactory.cc/uarm/ Seem a little bit in limited supply at the moment. *looks* great though :) (price to match though!) Michael. On 9 February 2016 at 16:47, Nicholas H.Tollervey wrote: > For those makers among you... anyone got access to one of these beauties..? > > > https://www.kickstarter.com/projects/ufactory/uarm-put-a-miniature-industrial-robot-arm-on-your?ref=live > > The name fits..? But will a micro:bit..? > > :-) > > N. > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nevil.hunt at hotmail.co.uk Wed Feb 10 12:09:05 2016 From: nevil.hunt at hotmail.co.uk (Nevil Hunt) Date: Wed, 10 Feb 2016 17:09:05 +0000 Subject: [Microbit-Python] =?windows-1252?q?Microbit-Python_=93Simon_Says?= =?windows-1252?q?=94_Example_for_Kitronik_Inventor=92s_Kit?= In-Reply-To: <56B8F452.8000102@ntoll.org> References: , <56B73847.80802@ntoll.org>, , , <56B8F452.8000102@ntoll.org> Message-ID: Hi Nicholas, I tried a bit of Beethoven from the Python Library which worked fine! Looking at it on the Scope it is still generated as a square wave. I've a feeling that the "Analog" outputs on the micro:bit are in fact PWM outputs so tones are generated by a PWM square wave of the appropriate frequency. If so then playing, say a .WAV file may not be possible. Does anyone know if the analog outputs can generate a genuine analog audio signal? Nevil To: microbit at python.org From: ntoll at ntoll.org Date: Mon, 8 Feb 2016 20:02:26 +0000 Subject: Re: [Microbit-Python] Microbit-Python ?Simon Says? Example for Kitronik Inventor?s Kit Nevil, We have a whole music module... See: http://microbit-micropython.readthedocs.org/en/latest/music.html :-) Happy to answer questions. N. On 08/02/16 16:10, Nevil Hunt wrote: > Hi Damien, > > The Inventor's Kit comes with a Piezo Buzzer since as it can be driven > directly from the P0 output pin. > A proper 8 ohm speaker needs an amp chip to drive it and as far as that > is concerned watch this space! > Looking on the 'scope, when I generate a note from Block it generates > more-or-less a square wave. Do you have the ability to generate proper > tunes using micro python? > Nicholas said there were memory limitations in playing .wav files > like you can using Python on the Raspberry Pi. > If you have anything that works using micro python I would quite like to > give it a go! > > Regards, > > Nevil > >> Date: Sun, 7 Feb 2016 23:10:07 +0000 >> From: damien.p.george at gmail.com >> To: microbit at python.org >> Subject: Re: [Microbit-Python] Microbit-Python ?Simon Says? Example > for Kitronik Inventor?s Kit >> >> Hi Nevil, >> >> Does the inventor's kit have a proper speaker (not just a buzzer)? If >> so when we can be even more creative with MicroPython and play tunes >> and notes through it. >> >> Cheers, >> Damien. >> >> >> On Sun, Feb 7, 2016 at 12:27 PM, Nicholas H.Tollervey > wrote: >> > Hi Nevil, >> > >> > Just a quick correction: it's Damien George who should be getting all >> > the thanks - he's the creator of MicroPython and has put in a huge >> > amount of work on this project. >> > >> > Without Damien we wouldn't have Python on the micro:bit. >> > >> > N. >> > >> > On 07/02/16 12:19, Nevil Hunt wrote: >> >> >> >> >> >> Hi, >> >> >> >> >> >> >> >> First of all I?d like to thank Nicholas for the Micro-Python initiative >> >> and Andrew Mulholland (who I met at the BETT show and who showed me how >> >> to get going with Microbit-Python). I am a STEM Ambassador and I?m >> >> working with one of the micro:bit partner companies, Kitronik, helping >> >> to get their resources ready for the roll out of the micro:bit into >> >> schools. In particular I?ve been helping get their ?Inventor?s Kit? >> >> ready. The Inventor?s Kit allows the micro:bit to connect to a >> >> Breadboard then comes with various electronic components (switches, >> >> LEDs, buzzers, motors, pots, etc) to experiment with connecting >> >> electronics to the micro:bit. The booklet that comes with the Kit > has 10 >> >> experiments along with the code to drive them. Four use ?Block? and six >> >> use ?Touch? but our plan is to publish many more on the web site >> >> (www.kitronik.co.uk/microbit ) We >> >> would like some of these to use Java and some to use Python. As you >> >> might imagine, things are quite busy. I am now up and running with >> >> Microbit-Python but I have limited time to write the example code so I >> >> thought I?d see if anyone on this forum fancied having a go! >> >> >> >> >> >> >> >> The first one we have in mind is a ?Simon Says? game where the >> >> Breadboard is fitted with 4 push switches (A,B,C,D) and a buzzer (see >> >> attached). Using the 4 corner LEDs of the micro:bit as the A,B,C,D >> >> lights the game starts by illuminating one random corner of the display >> >> e.g. ?B? and playing the note ?B? on the buzzer via P0. The player then >> >> has match this by pressing switch ?B? which illuminates ?B? and plays >> >> the note ?B?. The game then illuminates ?B? plus one more random > corner, >> >> e.g. ?D? while playing note ?D? on the buzzer. The player then has > match >> >> this by pressing switches ?B? and ?D? in sequence. The game > continues by >> >> adding another random letter to the sequence, e.g. ?B? ?D? ?A? then ?B? >> >> ?D? ?A? ?B? then ?B? ?D? ?A? ?B? ?C? etc with the score being the >> >> maximum length of sequence the player correctly repeats. The game ends >> >> when the player fails to match the sequence. >> >> >> >> >> >> >> >> So if you fancy having a go, post me the code and I will try it out. >> >> Since you are unlikely to have an Inventor?s Kit you could try > writing a >> >> simpler 2 switch version of the game using the ?A? and ?B? buttons on >> >> the micro:bit. >> >> >> >> >> >> >> >> Regards, >> >> >> >> >> >> >> >> Nevil Hunt >> >> >> >> STEM Ambassador >> >> >> >> >> >> >> >> _______________________________________________ >> >> 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 >> > >> _______________________________________________ >> 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 > _______________________________________________ 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 Wed Feb 10 12:12:27 2016 From: damien.p.george at gmail.com (Damien George) Date: Wed, 10 Feb 2016 17:12:27 +0000 Subject: [Microbit-Python] =?utf-8?q?Microbit-Python_=E2=80=9CSimon_Says?= =?utf-8?q?=E2=80=9D_Example_for_Kitronik_Inventor=E2=80=99s_Kit?= In-Reply-To: References: <56B73847.80802@ntoll.org> <56B8F452.8000102@ntoll.org> Message-ID: No, the outputs can't do real analog signals. It would need a DAC (digital to analog) for that. On Wed, Feb 10, 2016 at 5:09 PM, Nevil Hunt wrote: > Hi Nicholas, > > I tried a bit of Beethoven from the Python Library which worked fine! > Looking at it on the Scope it is still generated as a square wave. > I've a feeling that the "Analog" outputs on the micro:bit are in fact PWM > outputs so tones are generated by a PWM square wave of the appropriate > frequency. > If so then playing, say a .WAV file may not be possible. > Does anyone know if the analog outputs can generate a genuine analog audio > signal? > > Nevil > > To: microbit at python.org > From: ntoll at ntoll.org > Date: Mon, 8 Feb 2016 20:02:26 +0000 > > Subject: Re: [Microbit-Python] Microbit-Python ?Simon Says? Example for > Kitronik Inventor?s Kit > > Nevil, > > We have a whole music module... See: > > http://microbit-micropython.readthedocs.org/en/latest/music.html > > :-) > > Happy to answer questions. > > N. > > On 08/02/16 16:10, Nevil Hunt wrote: >> Hi Damien, >> >> The Inventor's Kit comes with a Piezo Buzzer since as it can be driven >> directly from the P0 output pin. >> A proper 8 ohm speaker needs an amp chip to drive it and as far as that >> is concerned watch this space! >> Looking on the 'scope, when I generate a note from Block it generates >> more-or-less a square wave. Do you have the ability to generate proper >> tunes using micro python? >> Nicholas said there were memory limitations in playing .wav files >> like you can using Python on the Raspberry Pi. >> If you have anything that works using micro python I would quite like to >> give it a go! >> >> Regards, >> >> Nevil >> >>> Date: Sun, 7 Feb 2016 23:10:07 +0000 >>> From: damien.p.george at gmail.com >>> To: microbit at python.org >>> Subject: Re: [Microbit-Python] Microbit-Python ?Simon Says? Example >> for Kitronik Inventor?s Kit >>> >>> Hi Nevil, >>> >>> Does the inventor's kit have a proper speaker (not just a buzzer)? If >>> so when we can be even more creative with MicroPython and play tunes >>> and notes through it. >>> >>> Cheers, >>> Damien. >>> >>> >>> On Sun, Feb 7, 2016 at 12:27 PM, Nicholas H.Tollervey >> wrote: >>> > Hi Nevil, >>> > >>> > Just a quick correction: it's Damien George who should be getting all >>> > the thanks - he's the creator of MicroPython and has put in a huge >>> > amount of work on this project. >>> > >>> > Without Damien we wouldn't have Python on the micro:bit. >>> > >>> > N. >>> > >>> > On 07/02/16 12:19, Nevil Hunt wrote: >>> >> >>> >> >>> >> Hi, >>> >> >>> >> >>> >> >>> >> First of all I?d like to thank Nicholas for the Micro-Python >>> >> initiative >>> >> and Andrew Mulholland (who I met at the BETT show and who showed me >>> >> how >>> >> to get going with Microbit-Python). I am a STEM Ambassador and I?m >>> >> working with one of the micro:bit partner companies, Kitronik, helping >>> >> to get their resources ready for the roll out of the micro:bit into >>> >> schools. In particular I?ve been helping get their ?Inventor?s Kit? >>> >> ready. The Inventor?s Kit allows the micro:bit to connect to a >>> >> Breadboard then comes with various electronic components (switches, >>> >> LEDs, buzzers, motors, pots, etc) to experiment with connecting >>> >> electronics to the micro:bit. The booklet that comes with the Kit >> has 10 >>> >> experiments along with the code to drive them. Four use ?Block? and >>> >> six >>> >> use ?Touch? but our plan is to publish many more on the web site >>> >> (www.kitronik.co.uk/microbit ) We >>> >> would like some of these to use Java and some to use Python. As you >>> >> might imagine, things are quite busy. I am now up and running with >>> >> Microbit-Python but I have limited time to write the example code so I >>> >> thought I?d see if anyone on this forum fancied having a go! >>> >> >>> >> >>> >> >>> >> The first one we have in mind is a ?Simon Says? game where the >>> >> Breadboard is fitted with 4 push switches (A,B,C,D) and a buzzer (see >>> >> attached). Using the 4 corner LEDs of the micro:bit as the A,B,C,D >>> >> lights the game starts by illuminating one random corner of the >>> >> display >>> >> e.g. ?B? and playing the note ?B? on the buzzer via P0. The player >>> >> then >>> >> has match this by pressing switch ?B? which illuminates ?B? and plays >>> >> the note ?B?. The game then illuminates ?B? plus one more random >> corner, >>> >> e.g. ?D? while playing note ?D? on the buzzer. The player then has >> match >>> >> this by pressing switches ?B? and ?D? in sequence. The game >> continues by >>> >> adding another random letter to the sequence, e.g. ?B? ?D? ?A? then >>> >> ?B? >>> >> ?D? ?A? ?B? then ?B? ?D? ?A? ?B? ?C? etc with the score being the >>> >> maximum length of sequence the player correctly repeats. The game ends >>> >> when the player fails to match the sequence. >>> >> >>> >> >>> >> >>> >> So if you fancy having a go, post me the code and I will try it out. >>> >> Since you are unlikely to have an Inventor?s Kit you could try >> writing a >>> >> simpler 2 switch version of the game using the ?A? and ?B? buttons on >>> >> the micro:bit. >>> >> >>> >> >>> >> >>> >> Regards, >>> >> >>> >> >>> >> >>> >> Nevil Hunt >>> >> >>> >> STEM Ambassador >>> >> >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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 >>> > >>> _______________________________________________ >>> 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 >> > > > > > _______________________________________________ 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 ntoll at ntoll.org Wed Feb 10 13:31:11 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Wed, 10 Feb 2016 18:31:11 +0000 Subject: [Microbit-Python] =?utf-8?q?Microbit-Python_=E2=80=9CSimon_Says?= =?utf-8?q?=E2=80=9D_Example_for_Kitronik_Inventor=E2=80=99s_Kit?= In-Reply-To: References: <56B73847.80802@ntoll.org> <56B8F452.8000102@ntoll.org> Message-ID: <56BB81EF.4070903@ntoll.org> Hi Nevil, What Damien said... :-) Really looking forward to seeing what you come up with. Is the source code anywhere? N. On 10/02/16 17:09, Nevil Hunt wrote: > Hi Nicholas, > > I tried a bit of Beethoven from the Python Library which worked fine! > Looking at it on the Scope it is still generated as a square wave. > I've a feeling that the "Analog" outputs on the micro:bit are in fact > PWM outputs so tones are generated by a PWM square wave of the > appropriate frequency. > If so then playing, say a .WAV file may not be possible. > Does anyone know if the analog outputs can generate a genuine analog > audio signal? > > Nevil > > To: microbit at python.org > From: ntoll at ntoll.org > Date: Mon, 8 Feb 2016 20:02:26 +0000 > Subject: Re: [Microbit-Python] Microbit-Python ?Simon Says? Example for > Kitronik Inventor?s Kit > > Nevil, > > We have a whole music module... See: > > http://microbit-micropython.readthedocs.org/en/latest/music.html > > :-) > > Happy to answer questions. > > N. > > On 08/02/16 16:10, Nevil Hunt wrote: >> Hi Damien, >> >> The Inventor's Kit comes with a Piezo Buzzer since as it can be driven >> directly from the P0 output pin. >> A proper 8 ohm speaker needs an amp chip to drive it and as far as that >> is concerned watch this space! >> Looking on the 'scope, when I generate a note from Block it generates >> more-or-less a square wave. Do you have the ability to generate proper >> tunes using micro python? >> Nicholas said there were memory limitations in playing .wav files >> like you can using Python on the Raspberry Pi. >> If you have anything that works using micro python I would quite like to >> give it a go! >> >> Regards, >> >> Nevil >> >>> Date: Sun, 7 Feb 2016 23:10:07 +0000 >>> From: damien.p.george at gmail.com >>> To: microbit at python.org >>> Subject: Re: [Microbit-Python] Microbit-Python ?Simon Says? Example >> for Kitronik Inventor?s Kit >>> >>> Hi Nevil, >>> >>> Does the inventor's kit have a proper speaker (not just a buzzer)? If >>> so when we can be even more creative with MicroPython and play tunes >>> and notes through it. >>> >>> Cheers, >>> Damien. >>> >>> >>> On Sun, Feb 7, 2016 at 12:27 PM, Nicholas H.Tollervey >> wrote: >>> > Hi Nevil, >>> > >>> > Just a quick correction: it's Damien George who should be getting all >>> > the thanks - he's the creator of MicroPython and has put in a huge >>> > amount of work on this project. >>> > >>> > Without Damien we wouldn't have Python on the micro:bit. >>> > >>> > N. >>> > >>> > On 07/02/16 12:19, Nevil Hunt wrote: >>> >> >>> >> >>> >> Hi, >>> >> >>> >> >>> >> >>> >> First of all I?d like to thank Nicholas for the Micro-Python initiative >>> >> and Andrew Mulholland (who I met at the BETT show and who showed me how >>> >> to get going with Microbit-Python). I am a STEM Ambassador and I?m >>> >> working with one of the micro:bit partner companies, Kitronik, helping >>> >> to get their resources ready for the roll out of the micro:bit into >>> >> schools. In particular I?ve been helping get their ?Inventor?s Kit? >>> >> ready. The Inventor?s Kit allows the micro:bit to connect to a >>> >> Breadboard then comes with various electronic components (switches, >>> >> LEDs, buzzers, motors, pots, etc) to experiment with connecting >>> >> electronics to the micro:bit. The booklet that comes with the Kit >> has 10 >>> >> experiments along with the code to drive them. Four use ?Block? and six >>> >> use ?Touch? but our plan is to publish many more on the web site >>> >> (www.kitronik.co.uk/microbit ) We >>> >> would like some of these to use Java and some to use Python. As you >>> >> might imagine, things are quite busy. I am now up and running with >>> >> Microbit-Python but I have limited time to write the example code so I >>> >> thought I?d see if anyone on this forum fancied having a go! >>> >> >>> >> >>> >> >>> >> The first one we have in mind is a ?Simon Says? game where the >>> >> Breadboard is fitted with 4 push switches (A,B,C,D) and a buzzer (see >>> >> attached). Using the 4 corner LEDs of the micro:bit as the A,B,C,D >>> >> lights the game starts by illuminating one random corner of the display >>> >> e.g. ?B? and playing the note ?B? on the buzzer via P0. The player then >>> >> has match this by pressing switch ?B? which illuminates ?B? and plays >>> >> the note ?B?. The game then illuminates ?B? plus one more random >> corner, >>> >> e.g. ?D? while playing note ?D? on the buzzer. The player then has >> match >>> >> this by pressing switches ?B? and ?D? in sequence. The game >> continues by >>> >> adding another random letter to the sequence, e.g. ?B? ?D? ?A? then ?B? >>> >> ?D? ?A? ?B? then ?B? ?D? ?A? ?B? ?C? etc with the score being the >>> >> maximum length of sequence the player correctly repeats. The game ends >>> >> when the player fails to match the sequence. >>> >> >>> >> >>> >> >>> >> So if you fancy having a go, post me the code and I will try it out. >>> >> Since you are unlikely to have an Inventor?s Kit you could try >> writing a >>> >> simpler 2 switch version of the game using the ?A? and ?B? buttons on >>> >> the micro:bit. >>> >> >>> >> >>> >> >>> >> Regards, >>> >> >>> >> >>> >> >>> >> Nevil Hunt >>> >> >>> >> STEM Ambassador >>> >> >>> >> >>> >> >>> >> _______________________________________________ >>> >> 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 >>> > >>> _______________________________________________ >>> 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 >> > > > > > _______________________________________________ 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 mschafer at wireframe.biz Wed Feb 10 17:48:24 2016 From: mschafer at wireframe.biz (Mark Schafer) Date: Thu, 11 Feb 2016 11:48:24 +1300 Subject: [Microbit-Python] =?utf-8?q?Microbit-Python_=E2=80=9CSimon_Says?= =?utf-8?q?=E2=80=9D_Example_for_Kitronik_Inventor=E2=80=99s_Kit?= In-Reply-To: <56BB81EF.4070903@ntoll.org> References: <56B73847.80802@ntoll.org> <56B8F452.8000102@ntoll.org> <56BB81EF.4070903@ntoll.org> Message-ID: <56BBBE38.5010502@wireframe.biz> An HTML attachment was scrubbed... URL: From microbit at sheep.art.pl Thu Feb 11 02:21:40 2016 From: microbit at sheep.art.pl (Radomir Dopieralski) Date: Thu, 11 Feb 2016 08:21:40 +0100 Subject: [Microbit-Python] =?utf-8?q?Microbit-Python_=E2=80=9CSimon_Says?= =?utf-8?q?=E2=80=9D_Example_for_Kitronik_Inventor=E2=80=99s_Kit?= In-Reply-To: References: <56B73847.80802@ntoll.org> <56B8F452.8000102@ntoll.org> Message-ID: <20160211082140.25828b5d@ghostwheel> You can use a much higher frequency PWM and a capacitor to get actual analog signal, or you can use several digital pins and a ladder of resistors. Both approaches would let you play arbitrary sounds with limited quality. On Wed, 10 Feb 2016 17:09:05 +0000 Nevil Hunt wrote: > Hi Nicholas, > > I tried a bit of Beethoven from the Python Library which worked fine! > Looking at it on the Scope it is still generated as a square wave. > I've a feeling that the "Analog" outputs on the micro:bit are in fact > PWM outputs so tones are generated by a PWM square wave of the > appropriate frequency. If so then playing, say a .WAV file may not be > possible. Does anyone know if the analog outputs can generate a > genuine analog audio signal? Nevil -- Radomir Dopieralski From russell at keith-magee.com Wed Feb 17 20:01:10 2016 From: russell at keith-magee.com (Russell Keith-Magee) Date: Thu, 18 Feb 2016 09:01:10 +0800 Subject: [Microbit-Python] Power specification for Micro:bit In-Reply-To: <56B0B365.5090500@egenix.com> References: <56B0B365.5090500@egenix.com> Message-ID: Hi all, On Tue, Feb 2, 2016 at 9:47 PM, M.-A. Lemburg wrote: > On 02.02.2016 03:42, Russell Keith-Magee wrote: > > Hi all, > > > > Can anyone confirm the power requirements/restrictions for the JST PH > > socket on the Micro:bit? > > > > I know it?s nominally 3V, with button cells or a pair of AAA?s providing > > that power; but if I use a LiPoly battery such as this one: > > > > > http://core-electronics.com.au/lithium-ion-polymer-battery-3-7v-500mah.html > > > > which will guarantee 3V, but may provide up to 4.7V depending on the > charge > > in the battery - am I going to fry anything? Is the voltage regulator > > managing the 5V line from the USB connector also used for the battery > input? > > When connecting a USB device to the MB, the battery pins in the > connector and power pins on the board show a reading of 3.2-3.3V, > so I guess that's what the board likes to run with. > > This board is very similar to the MB, so perhaps you could > glean some infos from their specs: > > https://www.mbed.com/en/development/hardware/boards/nordic/nrf51822/ > > Their spec for the power supply is 1.8V - 3.6V (pages 8 and 9): > > https://www.nordicsemi.com/eng/nordic/download_resource/30462/1/12808762 > > AFAIK, Radomir can confirm that using 6V is definitely too much > for the MB ;-)... > > https://microworldtour.github.io/microbit/mahiri.html In the best tradition of ?what?s the worst that could possibly happen?, I?ve taken the plunge and Just Done It, with the 3.7V 500mAh LiPo battery listed in my previous message. It worked a treat. No magic smoke escape or anything :-) This is entirely anecdata. This is not a warranty. If you do the same thing and yours breaks, you get to keep all the shiny pieces, etc, etc. :-) Yours, Russ Magee %-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ntoll at ntoll.org Thu Feb 18 03:10:36 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Thu, 18 Feb 2016 08:10:36 +0000 Subject: [Microbit-Python] Power specification for Micro:bit In-Reply-To: References: <56B0B365.5090500@egenix.com> Message-ID: <56C57C7C.3060906@ntoll.org> On 18/02/16 01:01, Russell Keith-Magee wrote: > This is entirely anecdata. This is not a warranty. If you do the same > thing and yours breaks, you get to keep all the shiny pieces, etc, etc. :-) > You sound the like the BBC lawyers I have to deal with... ;-) 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 loopspace at mathforge.org Thu Feb 18 07:04:52 2016 From: loopspace at mathforge.org (Loop Space) Date: Thu, 18 Feb 2016 12:04:52 +0000 Subject: [Microbit-Python] Accelerometer orientation Message-ID: <56C5B364.2030602@mathforge.org> Hi all, Brief intro: I recently got a microbit as part of the initial roll-out to teachers. I've no experience with python, but plenty of experience with other scripting languages so using micropython seemed the easiest of the various options available to me. I'm using the mu editor to write and flash scripts to the microbit via USB serial link. So far, so good. I'm just testing stuff, and was trying to work with the readings from the accelerometer. When the microbit is just resting, that should basically tell me what direction "down" is in. I can use the following script to get its values: from microbit import * DELAY=100 while True: sleep(DELAY) x,y,z = accelerometer.get_x(),accelerometer.get_y(),accelerometer.get_z() print(x,y,z) Via the REPL interface in mu, I get a stream of values. As I turn the microbit, obviously those values change. With the microbit essentially flat (leds uppermost), the vector is heavily weighted negatively in its z-component (values of the order of -1000). This says that the z-axis goes vertically up from the leds. By turning the microbit, I can find where the other axes point. This gets to my question. It would appear that the x-axis runs across the microbit with positive x-axis running out towards the B button, whilst the y-axis runs from the leds to the pins. As far as I can tell, that means that the microbit's orientation is left-handed as opposed to the almost universally accepted right-hand axes. Is my analysis right? Or am I misinterpreting what the numbers from the accelerometer mean? Thanks, Andrew From damien.p.george at gmail.com Thu Feb 18 09:10:29 2016 From: damien.p.george at gmail.com (Damien George) Date: Thu, 18 Feb 2016 14:10:29 +0000 Subject: [Microbit-Python] Accelerometer orientation In-Reply-To: <56C5B364.2030602@mathforge.org> References: <56C5B364.2030602@mathforge.org> Message-ID: Hi Andrew, Your analysis is correct. It seems that the (universally accepted?) convention for accelerometer chips is that they give a positive reading on the axis if that axis is pointing *away* from the centre of the Earth. With this convention the axis is right handed. Basically their convention is that "up" is positive, for all 3 axis. Since gravity is oriented "down" that makes it inverted in your analysis. Note that if you were in free space (free fall, no gravity), then the axis will read positive in the direction you accelerate. Cheers, Damien. On Thu, Feb 18, 2016 at 12:04 PM, Loop Space wrote: > Hi all, > > Brief intro: I recently got a microbit as part of the initial roll-out to > teachers. I've no experience with python, but plenty of experience with > other scripting languages so using micropython seemed the easiest of the > various options available to me. I'm using the mu editor to write and flash > scripts to the microbit via USB serial link. > > So far, so good. > > I'm just testing stuff, and was trying to work with the readings from the > accelerometer. When the microbit is just resting, that should basically > tell me what direction "down" is in. I can use the following script to get > its values: > > from microbit import * > > DELAY=100 > > while True: > sleep(DELAY) > x,y,z = > accelerometer.get_x(),accelerometer.get_y(),accelerometer.get_z() > print(x,y,z) > > Via the REPL interface in mu, I get a stream of values. As I turn the > microbit, obviously those values change. > > With the microbit essentially flat (leds uppermost), the vector is heavily > weighted negatively in its z-component (values of the order of -1000). This > says that the z-axis goes vertically up from the leds. By turning the > microbit, I can find where the other axes point. > > This gets to my question. It would appear that the x-axis runs across the > microbit with positive x-axis running out towards the B button, whilst the > y-axis runs from the leds to the pins. > > As far as I can tell, that means that the microbit's orientation is > left-handed as opposed to the almost universally accepted right-hand axes. > > Is my analysis right? Or am I misinterpreting what the numbers from the > accelerometer mean? > > Thanks, > Andrew > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit From mal at egenix.com Thu Feb 18 09:13:20 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Thu, 18 Feb 2016 15:13:20 +0100 Subject: [Microbit-Python] Accelerometer orientation In-Reply-To: <56C5B364.2030602@mathforge.org> References: <56C5B364.2030602@mathforge.org> Message-ID: <56C5D180.6000506@egenix.com> On 18.02.2016 13:04, Loop Space wrote: > Hi all, > > Brief intro: I recently got a microbit as part of the initial roll-out to teachers. I've no > experience with python, but plenty of experience with other scripting languages so using micropython > seemed the easiest of the various options available to me. I'm using the mu editor to write and > flash scripts to the microbit via USB serial link. > > So far, so good. > > I'm just testing stuff, and was trying to work with the readings from the accelerometer. When the > microbit is just resting, that should basically tell me what direction "down" is in. I can use the > following script to get its values: > > from microbit import * > > DELAY=100 > > while True: > sleep(DELAY) > x,y,z = accelerometer.get_x(),accelerometer.get_y(),accelerometer.get_z() > print(x,y,z) > > Via the REPL interface in mu, I get a stream of values. As I turn the microbit, obviously those > values change. > > With the microbit essentially flat (leds uppermost), the vector is heavily weighted negatively in > its z-component (values of the order of -1000). This says that the z-axis goes vertically up from > the leds. By turning the microbit, I can find where the other axes point. > > This gets to my question. It would appear that the x-axis runs across the microbit with positive > x-axis running out towards the B button, whilst the y-axis runs from the leds to the pins. > > As far as I can tell, that means that the microbit's orientation is left-handed as opposed to the > almost universally accepted right-hand axes. > > Is my analysis right? Or am I misinterpreting what the numbers from the accelerometer mean? The values of the meter go from -1024 to +1024. Now, let's assume you are holding the MB horizontally, with the LED panel up and the pins pointing to you. For the x-axis, it's +1024, if you hold the MB vertically with the B button pointing down and -1024 if you hold it in the other direction, with button A down. It's 0 if you hold the MB horizontally. For the y-axis, you get -1024 if you turn the MB up, so that the pins point to the sky, 0 when it's held horizontally and +1024, when turning the MB so that the pins point down. The "accelerate" part in accelerometer doesn't seem to have much meaning for x- and y-axis, i.e. they don't seem to measure acceleration, but instead orientation. Only the z-axis appears to actually work in terms of acceleration, since it changes its value depending on how you whether the MB up and and down. I haven't found a good use for the z-axis yet. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Feb 18 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 Thu Feb 18 12:33:06 2016 From: microbit at sheep.art.pl (Radomir Dopieralski) Date: Thu, 18 Feb 2016 18:33:06 +0100 Subject: [Microbit-Python] Accelerometer orientation In-Reply-To: <56C5D180.6000506@egenix.com> References: <56C5B364.2030602@mathforge.org> <56C5D180.6000506@egenix.com> Message-ID: <20160218183306.2434ba38@ghostwheel> On Thu, 18 Feb 2016 15:13:20 +0100 "M.-A. Lemburg" wrote: > On 18.02.2016 13:04, Loop Space wrote: [snip] > The values of the meter go from -1024 to +1024. Actually no, this is not true. The measurements are not normalized, they just give you the acceleration measured in 1/1000th of a g. Thus, with it lying flat and not moving you get 1g down. See https://en.wikipedia.org/wiki/Gravity_of_Earth > Now, let's assume you are holding the MB horizontally, > with the LED panel up and the pins pointing to you. > > For the x-axis, it's +1024, if you hold the MB vertically with > the B button pointing down and -1024 if you hold it in the > other direction, with button A down. It's 0 if you hold the MB > horizontally. It's actually +1000 and -1000. Provided it doesn't otherwise move. > For the y-axis, you get -1024 if you turn the MB up, so that > the pins point to the sky, 0 when it's held horizontally and > +1024, when turning the MB so that the pins point down. Same here. > The "accelerate" part in accelerometer doesn't seem to > have much meaning for x- and y-axis, i.e. they don't seem to > measure acceleration, but instead orientation. Only the z-axis > appears to actually work in terms of acceleration, since it > changes its value depending on how you whether the MB up and > and down. Of course they measure acceleration. This is the whole point. The thing is, gravity is impossible to tell from acceleration (Einstein even claims it's pretty much the same thing), so you end up also measuring gravity. Which can be used to tell the orientation while you are within the gravity field of Earth (and not in a free fall). All axes actually work in terms of acceleration -- you can see that by shaking the microbit sideways. And you can see you can get much higher values than 1024. Maybe we could even make a game that records the highest acceleration. Then again, maybe not, because then kids would throw it against the wall... > I haven't found a good use for the z-axis yet. All the axes are equally useful. You can use atan2 function to get actual angle from them. -- Radomir Dopieralski -- Radomir Dopieralski From mal at egenix.com Thu Feb 18 13:56:52 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Thu, 18 Feb 2016 19:56:52 +0100 Subject: [Microbit-Python] Accelerometer orientation In-Reply-To: <20160218183306.2434ba38@ghostwheel> References: <56C5B364.2030602@mathforge.org> <56C5D180.6000506@egenix.com> <20160218183306.2434ba38@ghostwheel> Message-ID: <56C613F4.4030108@egenix.com> On 18.02.2016 18:33, Radomir Dopieralski wrote: > On Thu, 18 Feb 2016 15:13:20 +0100 > "M.-A. Lemburg" wrote: > >> On 18.02.2016 13:04, Loop Space wrote: > [snip] > > >> The values of the meter go from -1024 to +1024. > > Actually no, this is not true. The measurements are not normalized, > they just give you the acceleration measured in 1/1000th of a g. Thus, > with it lying flat and not moving you get 1g down. > > See https://en.wikipedia.org/wiki/Gravity_of_Earth I'll have to recheck. When I did the experiments with the MB some weeks ago, those were the values I found (and it was not moving). >> Now, let's assume you are holding the MB horizontally, >> with the LED panel up and the pins pointing to you. >> >> For the x-axis, it's +1024, if you hold the MB vertically with >> the B button pointing down and -1024 if you hold it in the >> other direction, with button A down. It's 0 if you hold the MB >> horizontally. > > It's actually +1000 and -1000. Provided it doesn't otherwise move. > >> For the y-axis, you get -1024 if you turn the MB up, so that >> the pins point to the sky, 0 when it's held horizontally and >> +1024, when turning the MB so that the pins point down. > > Same here. > >> The "accelerate" part in accelerometer doesn't seem to >> have much meaning for x- and y-axis, i.e. they don't seem to >> measure acceleration, but instead orientation. Only the z-axis >> appears to actually work in terms of acceleration, since it >> changes its value depending on how you whether the MB up and >> and down. > > Of course they measure acceleration. This is the whole point. The thing > is, gravity is impossible to tell from acceleration (Einstein even > claims it's pretty much the same thing), so you end up also measuring > gravity. Which can be used to tell the orientation while you are within > the gravity field of Earth (and not in a free fall). Well, I know the term "acceleration" as referring to a change in velocity (first derivative of the latter). If a mass doesn't move, velocity is zero and thus acceleration is zero too. But I see your point: the accelerometer is not measuring acceleration, it's measuring g-force and then the readings make sense again. My misunderstanding :-) > All axes actually work in terms of acceleration -- you can see that by > shaking the microbit sideways. And you can see you can get much higher > values than 1024. > > Maybe we could even make a game that records the highest acceleration. > Then again, maybe not, because then kids would throw it against the > wall... I'll try that ... uhm, better not :-) >> I haven't found a good use for the z-axis yet. > > All the axes are equally useful. You can use atan2 function to get > actual angle from them. Right... giving me the orientation in space when the MB is not moving. Anyways, it does work nicely for x- and y-axis: https://www.youtube.com/watch?v=PwbfHcnkmNs -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Feb 18 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 loopspace at mathforge.org Thu Feb 18 12:33:53 2016 From: loopspace at mathforge.org (Loop Space) Date: Thu, 18 Feb 2016 17:33:53 +0000 Subject: [Microbit-Python] Accelerometer orientation In-Reply-To: References: <56C5B364.2030602@mathforge.org> Message-ID: <56C60081.2020303@mathforge.org> Damien, Thanks for that. This means that the microbit is the "correct" way up when the leds are facing downwards. As you say, then the axes are right-handed. Thanks, Andrew On 18/02/2016 14:10, Damien George wrote: > Hi Andrew, > > Your analysis is correct. It seems that the (universally accepted?) > convention for accelerometer chips is that they give a positive > reading on the axis if that axis is pointing *away* from the centre of > the Earth. With this convention the axis is right handed. > > Basically their convention is that "up" is positive, for all 3 axis. > Since gravity is oriented "down" that makes it inverted in your > analysis. > > Note that if you were in free space (free fall, no gravity), then the > axis will read positive in the direction you accelerate. > > Cheers, > Damien. > > > > > > > On Thu, Feb 18, 2016 at 12:04 PM, Loop Space wrote: >> Hi all, >> >> Brief intro: I recently got a microbit as part of the initial roll-out to >> teachers. I've no experience with python, but plenty of experience with >> other scripting languages so using micropython seemed the easiest of the >> various options available to me. I'm using the mu editor to write and flash >> scripts to the microbit via USB serial link. >> >> So far, so good. >> >> I'm just testing stuff, and was trying to work with the readings from the >> accelerometer. When the microbit is just resting, that should basically >> tell me what direction "down" is in. I can use the following script to get >> its values: >> >> from microbit import * >> >> DELAY=100 >> >> while True: >> sleep(DELAY) >> x,y,z = >> accelerometer.get_x(),accelerometer.get_y(),accelerometer.get_z() >> print(x,y,z) >> >> Via the REPL interface in mu, I get a stream of values. As I turn the >> microbit, obviously those values change. >> >> With the microbit essentially flat (leds uppermost), the vector is heavily >> weighted negatively in its z-component (values of the order of -1000). This >> says that the z-axis goes vertically up from the leds. By turning the >> microbit, I can find where the other axes point. >> >> This gets to my question. It would appear that the x-axis runs across the >> microbit with positive x-axis running out towards the B button, whilst the >> y-axis runs from the leds to the pins. >> >> As far as I can tell, that means that the microbit's orientation is >> left-handed as opposed to the almost universally accepted right-hand axes. >> >> Is my analysis right? Or am I misinterpreting what the numbers from the >> accelerometer mean? >> >> Thanks, >> Andrew >> _______________________________________________ >> 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 Fri Feb 19 13:11:54 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Fri, 19 Feb 2016 19:11:54 +0100 Subject: [Microbit-Python] Accelerometer orientation In-Reply-To: <56C613F4.4030108@egenix.com> References: <56C5B364.2030602@mathforge.org> <56C5D180.6000506@egenix.com> <20160218183306.2434ba38@ghostwheel> <56C613F4.4030108@egenix.com> Message-ID: <56C75AEA.90200@egenix.com> On 18.02.2016 19:56, M.-A. Lemburg wrote: > On 18.02.2016 18:33, Radomir Dopieralski wrote: >> On Thu, 18 Feb 2016 15:13:20 +0100 >> "M.-A. Lemburg" wrote: >> >>> On 18.02.2016 13:04, Loop Space wrote: >> [snip] >> >> >>> The values of the meter go from -1024 to +1024. >> >> Actually no, this is not true. The measurements are not normalized, >> they just give you the acceleration measured in 1/1000th of a g. Thus, >> with it lying flat and not moving you get 1g down. >> >> See https://en.wikipedia.org/wiki/Gravity_of_Earth > > I'll have to recheck. When I did the experiments with the MB some > weeks ago, those were the values I found (and it was not moving). I ran another series of tests. +/-1024 is still the figure I see when holding the MB vertically in x- and y-direction (perhaps just a coincident). -1024 is also the typical z-axis reading I get when holding the MB horizontally with the LED panel up, 1024 when turning the MB upside down (with the BBC logo up). However, by shaking the MB it does produce much higher values in both directions, corresponding to the g-force measurements you mentioned. >>> Now, let's assume you are holding the MB horizontally, >>> with the LED panel up and the pins pointing to you. >>> >>> For the x-axis, it's +1024, if you hold the MB vertically with >>> the B button pointing down and -1024 if you hold it in the >>> other direction, with button A down. It's 0 if you hold the MB >>> horizontally. >> >> It's actually +1000 and -1000. Provided it doesn't otherwise move. >> >>> For the y-axis, you get -1024 if you turn the MB up, so that >>> the pins point to the sky, 0 when it's held horizontally and >>> +1024, when turning the MB so that the pins point down. >> >> Same here. >> >>> The "accelerate" part in accelerometer doesn't seem to >>> have much meaning for x- and y-axis, i.e. they don't seem to >>> measure acceleration, but instead orientation. Only the z-axis >>> appears to actually work in terms of acceleration, since it >>> changes its value depending on how you whether the MB up and >>> and down. >> >> Of course they measure acceleration. This is the whole point. The thing >> is, gravity is impossible to tell from acceleration (Einstein even >> claims it's pretty much the same thing), so you end up also measuring >> gravity. Which can be used to tell the orientation while you are within >> the gravity field of Earth (and not in a free fall). > > Well, I know the term "acceleration" as referring to a change > in velocity (first derivative of the latter). If a mass doesn't > move, velocity is zero and thus acceleration is zero too. > > But I see your point: the accelerometer is not measuring > acceleration, it's measuring g-force and then the readings > make sense again. My misunderstanding :-) > >> All axes actually work in terms of acceleration -- you can see that by >> shaking the microbit sideways. And you can see you can get much higher >> values than 1024. >> >> Maybe we could even make a game that records the highest acceleration. >> Then again, maybe not, because then kids would throw it against the >> wall... > > I'll try that ... uhm, better not :-) > >>> I haven't found a good use for the z-axis yet. >> >> All the axes are equally useful. You can use atan2 function to get >> actual angle from them. > > Right... giving me the orientation in space when the MB is > not moving. > > Anyways, it does work nicely for x- and y-axis: > > https://www.youtube.com/watch?v=PwbfHcnkmNs > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Feb 19 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/ ________________________________________________________________________ 2016-02-19: Released eGenix PyRun 2.1.2 ... http://egenix.com/go88 ::: 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 Feb 19 15:25:45 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Fri, 19 Feb 2016 20:25:45 +0000 Subject: [Microbit-Python] Hello from Sunnyvale, CA! Message-ID: <56C77A49.6090800@ntoll.org> Hi Folks, I'm in California for an education conference at Google. This gave me 11 hours to kill on the flight over. As a result I finished off and revised some tutorials for teachers - to be added to the project documentation. I WOULD LOVE FEEDBACK! The tutorials are for beginners, miss a lot of things out (which you can discover via the "real" API docs anyway) and my intention is simply to provide a series of easy-to-understand Python related resources for teachers who may otherwise be feeling nervous. In an ideal world, teachers would adopt and adapt these resources into their own lesson plans and schemes-of-work. Feedback most welcome... The PR is here. https://github.com/bbcmicrobit/micropython/pull/212 (I think it'd be good to fix silly mistakes on this branch and merge ASAP so the "real" docs are updated for teachers to see. Subsequent additions, modifications and corrections can go in their own PRs). All the best, 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 larry at hastings.org Fri Feb 19 15:41:20 2016 From: larry at hastings.org (Larry Hastings) Date: Fri, 19 Feb 2016 15:41:20 -0500 Subject: [Microbit-Python] Hello from Sunnyvale, CA! In-Reply-To: <56C77A49.6090800@ntoll.org> Message-ID: <0f69f952-9d8f-4593-b689-df17f3e24236@email.android.com> I lived in Sunnyvale for thirteen years. If you want some restaurant recommendations, hit me up! On Feb 19, 2016 3:25 PM, "Nicholas H.Tollervey" wrote: > > Hi Folks, > > I'm in California for an education conference at Google. This gave me 11 > hours to kill on the flight over. As a result I finished off and revised > some tutorials for teachers - to be added to the project documentation. > > I WOULD LOVE FEEDBACK! > > The tutorials are for beginners, miss a lot of things out (which you can > discover via the "real" API docs anyway) and my intention is simply to > provide a series of easy-to-understand Python related resources for > teachers who may otherwise be feeling nervous. In an ideal world, > teachers would adopt and adapt these resources into their own lesson > plans and schemes-of-work. > > Feedback most welcome... > > The PR is here. > > https://github.com/bbcmicrobit/micropython/pull/212 > > (I think it'd be good to fix silly mistakes on this branch and merge > ASAP so the "real" docs are updated for teachers to see. Subsequent > additions, modifications and corrections can go in their own PRs). > > All the best, > > N. > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit From ntoll at ntoll.org Fri Feb 19 15:43:33 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Fri, 19 Feb 2016 20:43:33 +0000 Subject: [Microbit-Python] Hello from Sunnyvale, CA! In-Reply-To: <0f69f952-9d8f-4593-b689-df17f3e24236@email.android.com> References: <0f69f952-9d8f-4593-b689-df17f3e24236@email.android.com> Message-ID: <56C77E75.1080407@ntoll.org> On 19/02/16 20:41, Larry Hastings wrote: > I lived in Sunnyvale for thirteen years. If you want some restaurant recommendations, hit me up! > Ooh... didn't know that (I always assumed you were a Seattle-ite). Starting from this afternoon I'm going to be enclosed in a Google bubble of free food until Sunday evening. I'm kicking my heels on Monday as I wait for my 5pm flight. What's fun to see in Sunnyvale? 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 mal at egenix.com Fri Feb 19 15:55:18 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Fri, 19 Feb 2016 21:55:18 +0100 Subject: [Microbit-Python] Hello from Sunnyvale, CA! In-Reply-To: <56C77A49.6090800@ntoll.org> References: <56C77A49.6090800@ntoll.org> Message-ID: <56C78136.70509@egenix.com> On 19.02.2016 21:25, Nicholas H.Tollervey wrote: > Hi Folks, > > I'm in California for an education conference at Google. This gave me 11 > hours to kill on the flight over. As a result I finished off and revised > some tutorials for teachers - to be added to the project documentation. > > I WOULD LOVE FEEDBACK! Pretty impressive list of lesson ! The only nit I could find is the use of "from micropython import *". Wouldn't it be better to teach kids to use e.g. # First get the goodies you need for your program: from micropython import display, Image ... > The tutorials are for beginners, miss a lot of things out (which you can > discover via the "real" API docs anyway) and my intention is simply to > provide a series of easy-to-understand Python related resources for > teachers who may otherwise be feeling nervous. In an ideal world, > teachers would adopt and adapt these resources into their own lesson > plans and schemes-of-work. > > Feedback most welcome... > > The PR is here. > > https://github.com/bbcmicrobit/micropython/pull/212 > > (I think it'd be good to fix silly mistakes on this branch and merge > ASAP so the "real" docs are updated for teachers to see. Subsequent > additions, modifications and corrections can go in their own PRs). > > All the best, > > N. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Feb 19 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/ ________________________________________________________________________ 2016-02-19: Released eGenix PyRun 2.1.2 ... http://egenix.com/go88 ::: 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 larry at hastings.org Fri Feb 19 16:13:10 2016 From: larry at hastings.org (Larry Hastings) Date: Fri, 19 Feb 2016 16:13:10 -0500 Subject: [Microbit-Python] Hello from Sunnyvale, CA! In-Reply-To: <56C77E75.1080407@ntoll.org> Message-ID: Only in Seattle since 2011, lived in the bay area for more than thirty years before that. Sunnyvale isn't touristy, but you could drive around and see the leading lights of the tech industry. Or go to Fry's Electronics! On Feb 19, 2016 3:43 PM, "Nicholas H.Tollervey" wrote: > > On 19/02/16 20:41, Larry Hastings wrote: > > I lived in Sunnyvale for thirteen years. If you want some restaurant recommendations, hit me up! > > > > Ooh... didn't know that (I always assumed you were a Seattle-ite). > > Starting from this afternoon I'm going to be enclosed in a Google bubble > of free food until Sunday evening. I'm kicking my heels on Monday as I > wait for my 5pm flight. > > What's fun to see in Sunnyvale? > > N. > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit From ntoll at ntoll.org Fri Feb 19 16:13:57 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Fri, 19 Feb 2016 21:13:57 +0000 Subject: [Microbit-Python] Hello from Sunnyvale, CA! In-Reply-To: <56C78136.70509@egenix.com> References: <56C77A49.6090800@ntoll.org> <56C78136.70509@egenix.com> Message-ID: <56C78595.2010601@ntoll.org> Hi Marc Andre, On 19/02/16 20:55, M.-A. Lemburg wrote: > Pretty impressive list of lesson ! > Thank you! > The only nit I could find is the use of "from micropython import *". > Wouldn't it be better to teach kids to use e.g. > > # First get the goodies you need for your program: > from micropython import display, Image Hah. You wouldn't believe the deliberation that went into this style of import. :-) Put simply, while I agree explicit import is "the correct thing to do" in terms of "real" Python, we found that both kids and teachers were getting hung up with remembering to import the right sort of thing. Far better to encourage them to just import everything (it has no additional memory overhead) and not have to worry about things. We can show them the right way once their feeling more confident in their programming skills. Does this make sense? 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 ntoll at ntoll.org Fri Feb 19 16:15:03 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Fri, 19 Feb 2016 21:15:03 +0000 Subject: [Microbit-Python] Hello from Sunnyvale, CA! In-Reply-To: <56C78595.2010601@ntoll.org> References: <56C77A49.6090800@ntoll.org> <56C78136.70509@egenix.com> <56C78595.2010601@ntoll.org> Message-ID: <56C785D7.4090008@ntoll.org> ugh... their/they're. Blame jet-lag. ;-) On 19/02/16 21:13, Nicholas H.Tollervey wrote: > Hi Marc Andre, > > On 19/02/16 20:55, M.-A. Lemburg wrote: >> Pretty impressive list of lesson ! >> > > Thank you! > >> The only nit I could find is the use of "from micropython import *". >> Wouldn't it be better to teach kids to use e.g. >> >> # First get the goodies you need for your program: >> from micropython import display, Image > > Hah. You wouldn't believe the deliberation that went into this style of > import. :-) > > Put simply, while I agree explicit import is "the correct thing to do" > in terms of "real" Python, we found that both kids and teachers were > getting hung up with remembering to import the right sort of thing. Far > better to encourage them to just import everything (it has no additional > memory overhead) and not have to worry about things. We can show them > the right way once their feeling more confident in their programming skills. > > Does this make sense? > > N. > > > > _______________________________________________ > 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 ntoll at ntoll.org Fri Feb 19 16:18:30 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Fri, 19 Feb 2016 21:18:30 +0000 Subject: [Microbit-Python] Hello from Sunnyvale, CA! In-Reply-To: References: Message-ID: <56C786A6.1000904@ntoll.org> On 19/02/16 21:13, Larry Hastings wrote: > Only in Seattle since 2011, lived in the bay area for more than > thirty years before that. Sunnyvale isn't touristy, but you could > drive around and see the leading lights of the tech industry. Or go > to Fry's Electronics! > Hmm... I notice Sunnyvale isn't very pedestrian friendly (walking is how I mainly get around London). Also, I find American cars weird: the steering wheel is in the wrong place and you only have two pedals. :-P Might try Fry's on Monday. Thank you for the suggestion..! :-) 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 mal at egenix.com Fri Feb 19 16:27:32 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Fri, 19 Feb 2016 22:27:32 +0100 Subject: [Microbit-Python] Hello from Sunnyvale, CA! In-Reply-To: <56C78595.2010601@ntoll.org> References: <56C77A49.6090800@ntoll.org> <56C78136.70509@egenix.com> <56C78595.2010601@ntoll.org> Message-ID: <56C788C4.9030005@egenix.com> On 19.02.2016 22:13, Nicholas H.Tollervey wrote: > Hi Marc Andre, > > On 19/02/16 20:55, M.-A. Lemburg wrote: >> Pretty impressive list of lessons ! >> > > Thank you! > >> The only nit I could find is the use of "from micropython import *". >> Wouldn't it be better to teach kids to use e.g. >> >> # First get the goodies you need for your program: >> from micropython import display, Image > > Hah. You wouldn't believe the deliberation that went into this style of > import. :-) > > Put simply, while I agree explicit import is "the correct thing to do" > in terms of "real" Python, we found that both kids and teachers were > getting hung up with remembering to import the right sort of thing. Far > better to encourage them to just import everything (it has no additional > memory overhead) and not have to worry about things. We can show them > the right way once their feeling more confident in their programming skills. > > Does this make sense? Yes, but I don't quite agree :-) If you want to work with some tools, you normally don't just throw them all on the table and then pick the ones you need. You go look for the hammer, the nails, the screw driver in your box and only pick the ones you need. Younger kids tend to use the first approach, but when they get to elementary schools they switch to the second more specific approach - well, at least my two kids did. Also note that you are using the proper "import music" and "import random" for all the other tools in the lessons, so there's a bit of mix in styles. Anyway, just a comment. BTW: Are there any plans to create a micropython module version which allows simulations on a regular Python installation ? I think this would make working with MicroPython and the MB a lot easier - you'd develop on the desktop and then deploy to the MB. I've seen some videos where the Microsoft environment does provide a simulator along those lines (but not when using Python). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Feb 19 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/ ________________________________________________________________________ 2016-02-19: Released eGenix PyRun 2.1.2 ... http://egenix.com/go88 ::: 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 loopspace at mathforge.org Fri Feb 19 15:36:22 2016 From: loopspace at mathforge.org (Loop Space) Date: Fri, 19 Feb 2016 20:36:22 +0000 Subject: [Microbit-Python] compiling micropython In-Reply-To: <56C77A49.6090800@ntoll.org> References: <56C77A49.6090800@ntoll.org> Message-ID: <56C77CC6.6080105@mathforge.org> Speaking of the micropython repository on github ... when I do the `yt up` stage, I get: info: get versions for microbit-dal error: Failed to satisfy dependencies of 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 On the README for https://github.com/lancaster-university/microbit it says that the microbit-dal is a private repository and to email joe at comp.lancs.ac.uk to get access. I did that at the start of this week and have had no response (that's not a complaint - I'm sure that Joe is busy enough). It seems a bit awkward for this project to rely on a private repository and for everyone who wants to use it to have to request access. Once these things get sent out, I can imagine quite a few people will prefer to use micropython than the browser editors, given that python seems to be the preferred language for schoolkids to learn. Andrew From ntoll at ntoll.org Fri Feb 19 18:14:29 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Fri, 19 Feb 2016 23:14:29 +0000 Subject: [Microbit-Python] compiling micropython In-Reply-To: <56C77CC6.6080105@mathforge.org> References: <56C77A49.6090800@ntoll.org> <56C77CC6.6080105@mathforge.org> Message-ID: <56C7A1D5.9000500@ntoll.org> Hi Andrew, I'm so sorry for this sad state of affairs, but this has been imposed upon us by circumstances beyond our control (the BBC and other partners - believe me, we've tried to push against this). Rest assured, the microbit-dal repos will be opened up (probably at the end of March at the earliest - although that's a finger in the air guess). Until such time, you'll need to send me your GitHub username and I'll make contact with Lancaster to get you added. N. On 19/02/16 20:36, Loop Space wrote: > Speaking of the micropython repository on github ... > > when I do the `yt up` stage, I get: > > info: get versions for microbit-dal > error: Failed to satisfy dependencies of 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 > > On the README for https://github.com/lancaster-university/microbit it > says that the microbit-dal is a private repository and to email > joe at comp.lancs.ac.uk to get access. I did that at the start of this > week and have had no response (that's not a complaint - I'm sure that > Joe is busy enough). > > It seems a bit awkward for this project to rely on a private repository > and for everyone who wants to use it to have to request access. Once > these things get sent out, I can imagine quite a few people will prefer > to use micropython than the browser editors, given that python seems to > be the preferred language for schoolkids to learn. > > Andrew > _______________________________________________ > 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 Fri Feb 19 18:14:44 2016 From: microbit at sheep.art.pl (Radomir Dopieralski) Date: Sat, 20 Feb 2016 00:14:44 +0100 Subject: [Microbit-Python] compiling micropython In-Reply-To: <56C77CC6.6080105@mathforge.org> References: <56C77A49.6090800@ntoll.org> <56C77CC6.6080105@mathforge.org> Message-ID: <20160220001444.0f358839@ghostwheel> Hi Andrew, you are absolutely right, this is awkward. Fortunately as soon as the boards are out there, the repository is supposed to become public. It's kept private just before the release -- that's a requirement from the BBC that we can do nothing about, unfortunately. On Fri, 19 Feb 2016 20:36:22 +0000 Loop Space wrote: > Speaking of the micropython repository on github ... > > when I do the `yt up` stage, I get: > > info: get versions for microbit-dal > error: Failed to satisfy dependencies of 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 > > On the README for https://github.com/lancaster-university/microbit it > says that the microbit-dal is a private repository and to email > joe at comp.lancs.ac.uk to get access. I did that at the start of this > week and have had no response (that's not a complaint - I'm sure that > Joe is busy enough). > > It seems a bit awkward for this project to rely on a private > repository and for everyone who wants to use it to have to request > access. Once these things get sent out, I can imagine quite a few > people will prefer to use micropython than the browser editors, given > that python seems to be the preferred language for schoolkids to > learn. -- Radomir Dopieralski From chris at chrisarndt.de Fri Feb 19 18:20:31 2016 From: chris at chrisarndt.de (Christopher Arndt) Date: Sat, 20 Feb 2016 00:20:31 +0100 Subject: [Microbit-Python] compiling micropython In-Reply-To: <56C77CC6.6080105@mathforge.org> References: <56C77A49.6090800@ntoll.org> <56C77CC6.6080105@mathforge.org> Message-ID: <56C7A33F.2050900@chrisarndt.de> Am 19.02.2016 um 21:36 schrieb Loop Space: > It seems a bit awkward for this project to rely on a private repository > and for everyone who wants to use it to have to request access. I may be missing something, but you can just use uflash (pip install uflash) to write the micropython firmware (and your script) to the micro:bit. The latest micropython binary is embedded into the uflash script. Chris From loopspace at mathforge.org Fri Feb 19 18:21:18 2016 From: loopspace at mathforge.org (Loop Space) Date: Fri, 19 Feb 2016 23:21:18 +0000 Subject: [Microbit-Python] compiling micropython In-Reply-To: <56C7A1D5.9000500@ntoll.org> References: <56C77A49.6090800@ntoll.org> <56C77CC6.6080105@mathforge.org> <56C7A1D5.9000500@ntoll.org> Message-ID: <56C7A36E.4070206@mathforge.org> Thanks Nicholas, my github username is 'loopspace' (and I'm recording my microbit experiments in https://github.com/loopspace/microbit). There's no particular rush as I've gotten it working via the mu editor, but it'd be nice to have the more direct access and the ability to use a different editor. Thanks, Andrew On 19/02/2016 23:14, Nicholas H.Tollervey wrote: > Hi Andrew, > > I'm so sorry for this sad state of affairs, but this has been imposed > upon us by circumstances beyond our control (the BBC and other partners > - believe me, we've tried to push against this). Rest assured, the > microbit-dal repos will be opened up (probably at the end of March at > the earliest - although that's a finger in the air guess). > > Until such time, you'll need to send me your GitHub username and I'll > make contact with Lancaster to get you added. > > N. > > On 19/02/16 20:36, Loop Space wrote: >> Speaking of the micropython repository on github ... >> >> when I do the `yt up` stage, I get: >> >> info: get versions for microbit-dal >> error: Failed to satisfy dependencies of 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 >> >> On the README for https://github.com/lancaster-university/microbit it >> says that the microbit-dal is a private repository and to email >> joe at comp.lancs.ac.uk to get access. I did that at the start of this >> week and have had no response (that's not a complaint - I'm sure that >> Joe is busy enough). >> >> It seems a bit awkward for this project to rely on a private repository >> and for everyone who wants to use it to have to request access. Once >> these things get sent out, I can imagine quite a few people will prefer >> to use micropython than the browser editors, given that python seems to >> be the preferred language for schoolkids to learn. >> >> Andrew >> _______________________________________________ >> 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 loopspace at mathforge.org Fri Feb 19 18:28:51 2016 From: loopspace at mathforge.org (Loop Space) Date: Fri, 19 Feb 2016 23:28:51 +0000 Subject: [Microbit-Python] compiling micropython In-Reply-To: <56C7A33F.2050900@chrisarndt.de> References: <56C77A49.6090800@ntoll.org> <56C77CC6.6080105@mathforge.org> <56C7A33F.2050900@chrisarndt.de> Message-ID: <56C7A533.3020801@mathforge.org> I was unaware of that. Thanks for the tip. I'll try that out. I confess I got a bit lost figuring out which micropython-related stuff was relevant to the microbit and probably didn't read every readme I came across. Andrew On 19/02/2016 23:20, Christopher Arndt wrote: > Am 19.02.2016 um 21:36 schrieb Loop Space: >> It seems a bit awkward for this project to rely on a private repository >> and for everyone who wants to use it to have to request access. > > I may be missing something, but you can just use uflash (pip install > uflash) to write the micropython firmware (and your script) to the > micro:bit. The latest micropython binary is embedded into the uflash script. > > > Chris > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > From radomir at dopieralski.pl Thu Feb 18 09:31:05 2016 From: radomir at dopieralski.pl (Radomir Dopieralski) Date: Thu, 18 Feb 2016 15:31:05 +0100 Subject: [Microbit-Python] Accelerometer orientation In-Reply-To: <56C5D180.6000506@egenix.com> References: <56C5B364.2030602@mathforge.org> <56C5D180.6000506@egenix.com> Message-ID: <20160218153105.6590ed7b@ghostwheel> On Thu, 18 Feb 2016 15:13:20 +0100 "M.-A. Lemburg" wrote: > On 18.02.2016 13:04, Loop Space wrote: [snip] > The values of the meter go from -1024 to +1024. Actually no, this is not true. The measurements are not normalized, they just give you the acceleration measured in 1/1000th of a g. Thus, with it lying flat and not moving you get 1g down. See https://en.wikipedia.org/wiki/Gravity_of_Earth > Now, let's assume you are holding the MB horizontally, > with the LED panel up and the pins pointing to you. > > For the x-axis, it's +1024, if you hold the MB vertically with > the B button pointing down and -1024 if you hold it in the > other direction, with button A down. It's 0 if you hold the MB > horizontally. It's actually +1000 and -1000. Provided it doesn't otherwise move. > For the y-axis, you get -1024 if you turn the MB up, so that > the pins point to the sky, 0 when it's held horizontally and > +1024, when turning the MB so that the pins point down. Same here. > The "accelerate" part in accelerometer doesn't seem to > have much meaning for x- and y-axis, i.e. they don't seem to > measure acceleration, but instead orientation. Only the z-axis > appears to actually work in terms of acceleration, since it > changes its value depending on how you whether the MB up and > and down. Of course they measure acceleration. This is the whole point. The thing is, gravity is impossible to tell from acceleration (Einstein even claims it's pretty much the same thing), so you end up also measuring gravity. Which can be used to tell the orientation while you are within the gravity field of Earth (and not in a free fall). All axes actually work in terms of acceleration -- you can see that by shaking the microbit sideways. And you can see you can get much higher values than 1024. Maybe we could even make a game that records the highest acceleration. Then again, maybe not, because then kids would throw it against the wall... > I haven't found a good use for the z-axis yet. All the axes are equally useful. You can use atan2 function to get actual angle from them. -- Radomir Dopieralski From russell at keith-magee.com Mon Feb 22 02:05:47 2016 From: russell at keith-magee.com (Russell Keith-Magee) Date: Mon, 22 Feb 2016 15:05:47 +0800 Subject: [Microbit-Python] Pointers on connecting microBit to the outside world Message-ID: Hi all, I feel like a bit of a dunce asking this, but can anyone point me in the right direction on using the micro:bit?s Bluetooth functionality? I?ve been trying to make my micro:bit an IoT sensor. My end goal is to convert a shake of the micro:bit into a hit on a web service. Doing the sensor part was trivial with microPython; but I can?t work out how to make the hop to the outside world. I assumed that the micro:bit would be identified as a BLE device, and could be paired with my laptop. However, I can?t find any way to identify the micro:bit as a Bluetooth device on my Mac (which supports BLE). I?m guessing there is something that needs to be enabled at an API level, but it isn?t clear to me what that would be. Can anyone point me in the right direction here? Yours, Russ Magee %-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mal at egenix.com Mon Feb 22 03:29:49 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Mon, 22 Feb 2016 09:29:49 +0100 Subject: [Microbit-Python] Pointers on connecting microBit to the outside world In-Reply-To: References: Message-ID: <56CAC6FD.7090505@egenix.com> On 22.02.2016 08:05, Russell Keith-Magee wrote: > Hi all, > > I feel like a bit of a dunce asking this, but can anyone point me in the > right direction on using the micro:bit?s Bluetooth functionality? > > I?ve been trying to make my micro:bit an IoT sensor. My end goal is to > convert a shake of the micro:bit into a hit on a web service. > > Doing the sensor part was trivial with microPython; but I can?t work out > how to make the hop to the outside world. > > I assumed that the micro:bit would be identified as a BLE device, and could > be paired with my laptop. However, I can?t find any way to identify the > micro:bit as a Bluetooth device on my Mac (which supports BLE). I?m > guessing there is something that needs to be enabled at an API level, but > it isn?t clear to me what that would be. > > Can anyone point me in the right direction here? AFAIK, bluetooth is not supported with MicroPython, the reason being that the bluetooth stack alone consumes 12kB of RAM, leaving only 4kB for MicroPython. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Feb 22 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/ ________________________________________________________________________ 2016-02-19: Released eGenix PyRun 2.1.2 ... http://egenix.com/go88 ::: 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 Feb 22 07:14:45 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 22 Feb 2016 12:14:45 +0000 Subject: [Microbit-Python] Pointers on connecting microBit to the outside world In-Reply-To: <56CAC6FD.7090505@egenix.com> References: <56CAC6FD.7090505@egenix.com> Message-ID: <56CAFBB5.8080503@ntoll.org> On 22/02/16 08:29, M.-A. Lemburg wrote: > On 22.02.2016 08:05, Russell Keith-Magee wrote: >> Hi all, >> >> I feel like a bit of a dunce asking this, but can anyone point me in the >> right direction on using the micro:bit?s Bluetooth functionality? >> >> I?ve been trying to make my micro:bit an IoT sensor. My end goal is to >> convert a shake of the micro:bit into a hit on a web service. >> >> Doing the sensor part was trivial with microPython; but I can?t work out >> how to make the hop to the outside world. >> >> I assumed that the micro:bit would be identified as a BLE device, and could >> be paired with my laptop. However, I can?t find any way to identify the >> micro:bit as a Bluetooth device on my Mac (which supports BLE). I?m >> guessing there is something that needs to be enabled at an API level, but >> it isn?t clear to me what that would be. >> >> Can anyone point me in the right direction here? > > AFAIK, bluetooth is not supported with MicroPython, the reason > being that the bluetooth stack alone consumes 12kB of RAM, > leaving only 4kB for MicroPython. > Yes, that. The "retail" boards (i.e. the ones you'll get via mail-order rather than the ones given to the kids in school) will apparently have 32k RAM which will mitigate the space problem. I guess we should mention in the docs that BLE isn't supported (yet). Any suggestions for where this notice should go would be most appreciated. 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 microbit at sheep.art.pl Mon Feb 22 07:32:51 2016 From: microbit at sheep.art.pl (Radomir Dopieralski) Date: Mon, 22 Feb 2016 13:32:51 +0100 Subject: [Microbit-Python] Pointers on connecting microBit to the outside world In-Reply-To: <56CAFBB5.8080503@ntoll.org> References: <56CAC6FD.7090505@egenix.com> <56CAFBB5.8080503@ntoll.org> Message-ID: <20160222133251.1d1f37a4@ghostwheel> Maybe we could put a "bluetooth" section in the docs, and just put a notice that it's not available in there. That's where I would look for it if I wanted to make use of it, anyways. On Mon, 22 Feb 2016 12:14:45 +0000 "Nicholas H.Tollervey" wrote: > On 22/02/16 08:29, M.-A. Lemburg wrote: > > On 22.02.2016 08:05, Russell Keith-Magee wrote: > >> Hi all, > >> > >> I feel like a bit of a dunce asking this, but can anyone point me > >> in the right direction on using the micro:bit?s Bluetooth > >> functionality? > >> > >> I?ve been trying to make my micro:bit an IoT sensor. My end goal > >> is to convert a shake of the micro:bit into a hit on a web service. > >> > >> Doing the sensor part was trivial with microPython; but I can?t > >> work out how to make the hop to the outside world. > >> > >> I assumed that the micro:bit would be identified as a BLE device, > >> and could be paired with my laptop. However, I can?t find any way > >> to identify the micro:bit as a Bluetooth device on my Mac (which > >> supports BLE). I?m guessing there is something that needs to be > >> enabled at an API level, but it isn?t clear to me what that would > >> be. > >> > >> Can anyone point me in the right direction here? > > > > AFAIK, bluetooth is not supported with MicroPython, the reason > > being that the bluetooth stack alone consumes 12kB of RAM, > > leaving only 4kB for MicroPython. > > > > Yes, that. The "retail" boards (i.e. the ones you'll get via > mail-order rather than the ones given to the kids in school) will > apparently have 32k RAM which will mitigate the space problem. > > I guess we should mention in the docs that BLE isn't supported (yet). > Any suggestions for where this notice should go would be most > appreciated. -- Radomir Dopieralski From sparks.m at gmail.com Mon Feb 22 07:39:50 2016 From: sparks.m at gmail.com (Michael) Date: Mon, 22 Feb 2016 12:39:50 +0000 Subject: [Microbit-Python] Pointers on connecting microBit to the outside world In-Reply-To: <20160222133251.1d1f37a4@ghostwheel> References: <56CAC6FD.7090505@egenix.com> <56CAFBB5.8080503@ntoll.org> <20160222133251.1d1f37a4@ghostwheel> Message-ID: On 22 February 2016 at 12:32, Radomir Dopieralski wrote: > Maybe we could put a "bluetooth" section in the docs, and just put a > notice that it's not available in there. That's where I would look for > it if I wanted to make use of it, anyways. > I think that's a great suggestion for what it's worth. Michael. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ntoll at ntoll.org Mon Feb 22 07:49:39 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 22 Feb 2016 12:49:39 +0000 Subject: [Microbit-Python] Pointers on connecting microBit to the outside world In-Reply-To: References: <56CAC6FD.7090505@egenix.com> <56CAFBB5.8080503@ntoll.org> <20160222133251.1d1f37a4@ghostwheel> Message-ID: <56CB03E3.6010203@ntoll.org> I'm on it. N. On 22/02/16 12:39, Michael wrote: > On 22 February 2016 at 12:32, Radomir Dopieralski > wrote: > > Maybe we could put a "bluetooth" section in the docs, and just put a > notice that it's not available in there. That's where I would look for > it if I wanted to make use of it, anyways. > > > I think that's a great suggestion for what it's worth. > > > Michael. > > > > _______________________________________________ > 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 Jonathan.Austin at arm.com Mon Feb 22 08:56:54 2016 From: Jonathan.Austin at arm.com (Jonathan Austin) Date: Mon, 22 Feb 2016 13:56:54 +0000 Subject: [Microbit-Python] compiling micropython In-Reply-To: <56C7A33F.2050900@chrisarndt.de> References: <56C77A49.6090800@ntoll.org> <56C77CC6.6080105@mathforge.org> <56C7A33F.2050900@chrisarndt.de> Message-ID: <18D8AEC3-A48D-4FEB-A1FC-7F28EA4E392A@arm.com> > On 19 Feb 2016, at 23:20, Christopher Arndt wrote: > Am 19.02.2016 um 21:36 schrieb Loop Space: >> It seems a bit awkward for this project to rely on a private repository >> and for everyone who wants to use it to have to request access. > > I may be missing something, but you can just use uflash (pip install > uflash) to write the micropython firmware (and your script) to the > micro:bit. The latest micropython binary is embedded into the uflash script. > I?m intrigued - you can actually just copy the right firmware onto the mass storage device that should be auto mounted (or you can manually mount) when you plug in the micro:bit For example: $ cp /path/to/micropython-microbit.hex /media/username/MICROBIT/ Does uflash handle concatenating your python script with the interpreter firmware too? Or is it just an easy way to get hold of an appropriate firmware image. If so, we should perhaps stick one up somewhere really obvious? Jonny > > Chris > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. From ntoll at ntoll.org Mon Feb 22 09:09:26 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 22 Feb 2016 14:09:26 +0000 Subject: [Microbit-Python] compiling micropython In-Reply-To: <18D8AEC3-A48D-4FEB-A1FC-7F28EA4E392A@arm.com> References: <56C77A49.6090800@ntoll.org> <56C77CC6.6080105@mathforge.org> <56C7A33F.2050900@chrisarndt.de> <18D8AEC3-A48D-4FEB-A1FC-7F28EA4E392A@arm.com> Message-ID: <56CB1696.2050209@ntoll.org> On 22/02/16 13:56, Jonathan Austin wrote: > I?m intrigued - you can actually just copy the right firmware onto the mass > storage device that should be auto mounted (or you can manually mount) when > you plug in the micro:bit > > For example: > $ cp /path/to/micropython-microbit.hex /media/username/MICROBIT/ > > Does uflash handle concatenating your python script with the interpreter > firmware too? Or is it just an easy way to get hold of an appropriate > firmware image. If so, we should perhaps stick one up somewhere really > obvious? > Hi Jonny, uflash contains an up-to-date version of the MicroPython hex. It auto-detects where the device is mounted. It does all the hexlifying of Python and concatenation to the afore mentioned MicroPython hex. It'll also extract Python from a hex. :-) Full docs here: http://uflash.readthedocs.org/ 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 m.richards at put.gdst.net Mon Feb 22 08:03:51 2016 From: m.richards at put.gdst.net (Richards, Martin (PUT)) Date: Mon, 22 Feb 2016 13:03:51 +0000 Subject: [Microbit-Python] Pointers on connecting microBit to the outside world In-Reply-To: <56CB03E3.6010203@ntoll.org> References: <56CAC6FD.7090505@egenix.com> <56CAFBB5.8080503@ntoll.org> <20160222133251.1d1f37a4@ghostwheel> <56CB03E3.6010203@ntoll.org> Message-ID: I read the note about the Bluetooth stack taking up 12KB. Would it ever be possible to have any Bluetooth functions with microPython ? Is there anyway of adapting the implementation for it to use a much reduced memory store? Eg. By having very restricted limited on the size of programs run, or the size of lists and data within the program? I understand that when the Python is compliled, much larger assembly is produced, but surely this could be limited in some way? Martin -----Original Message----- From: Microbit [mailto:microbit-bounces+m.richards=put.gdst.net at python.org] On Behalf Of Nicholas H.Tollervey Sent: 22 February 2016 12:50 To: microbit at python.org Subject: Re: [Microbit-Python] Pointers on connecting microBit to the outside world I'm on it. N. On 22/02/16 12:39, Michael wrote: > On 22 February 2016 at 12:32, Radomir Dopieralski > > wrote: > > Maybe we could put a "bluetooth" section in the docs, and just put a > notice that it's not available in there. That's where I would look for > it if I wanted to make use of it, anyways. > > > I think that's a great suggestion for what it's worth. > > > Michael. > > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > ________________________________ Important Notice This message and any files transmitted with it are confidential to the addressee. If you are not the intended recipient, any disclosure copying or distribution is prohibited and may be unlawful.You should notify the sender immediately and delete this message and any attachments without retaining a copy. Please note that any views or opinions expressed in this message are solely those of the author and may not represent those of the Company or School. No liability is accepted by The Girls' Day School Trust for any loss or damage incurred through use of this e-mail. The Girls' Day School Trust. A limited company Registered in England No. 6400 Registered Charity No. 306983. Registered Office: 100 Rochester Row, London SW1P 1JP ________________________________ From loopspace at mathforge.org Mon Feb 22 14:58:30 2016 From: loopspace at mathforge.org (Loop Space) Date: Mon, 22 Feb 2016 19:58:30 +0000 Subject: [Microbit-Python] Pointers on connecting microBit to the outside world In-Reply-To: References: <56CAC6FD.7090505@egenix.com> <56CAFBB5.8080503@ntoll.org> <20160222133251.1d1f37a4@ghostwheel> <56CB03E3.6010203@ntoll.org> Message-ID: <56CB6866.2090600@mathforge.org> I second this. One use of Bluetooth would be to get information off the microbit and onto a computer. All processing could be done by the computer so the microbit wouldn't have to have extensive capabilities. This would still be possible with reduced capability, if such were possible. Andrew On 22/02/2016 13:03, Richards, Martin (PUT) wrote: > I read the note about the Bluetooth stack taking up 12KB. Would it ever be possible to have any Bluetooth functions with microPython ? > > Is there anyway of adapting the implementation for it to use a much reduced memory store? Eg. By having very restricted limited on the size of programs run, or the size of lists and data within the program? > > I understand that when the Python is compliled, much larger assembly is produced, but surely this could be limited in some way? > > Martin > > -----Original Message----- > From: Microbit [mailto:microbit-bounces+m.richards=put.gdst.net at python.org] On Behalf Of Nicholas H.Tollervey > Sent: 22 February 2016 12:50 > To: microbit at python.org > Subject: Re: [Microbit-Python] Pointers on connecting microBit to the outside world > > I'm on it. > > N. > > On 22/02/16 12:39, Michael wrote: >> On 22 February 2016 at 12:32, Radomir Dopieralski >> > wrote: >> >> Maybe we could put a "bluetooth" section in the docs, and just put a >> notice that it's not available in there. That's where I would look for >> it if I wanted to make use of it, anyways. >> >> >> I think that's a great suggestion for what it's worth. >> >> >> Michael. >> >> >> >> _______________________________________________ >> Microbit mailing list >> Microbit at python.org >> https://mail.python.org/mailman/listinfo/microbit >> > > > ________________________________ > > Important Notice > > > This message and any files transmitted with it are confidential to the addressee. > If you are not the intended recipient, any disclosure copying or distribution is > prohibited and may be unlawful.You should notify the sender immediately > and delete this message and any attachments without retaining a copy. > > Please note that any views or opinions expressed in this message are solely > those of the author and may not represent those of the Company or School. > No liability is accepted by The Girls' Day School Trust for any loss or damage > incurred through use of this e-mail. > > The Girls' Day School Trust. A limited company Registered in England No. 6400 > Registered Charity No. 306983. Registered Office: 100 Rochester Row, London SW1P 1JP > > ________________________________ > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > From joe.t.glancy at gmail.com Tue Feb 23 05:51:14 2016 From: joe.t.glancy at gmail.com (Joe Glancy) Date: Tue, 23 Feb 2016 10:51:14 +0000 Subject: [Microbit-Python] Pointers on connecting microBit to the outside world In-Reply-To: <56CB6866.2090600@mathforge.org> References: <56CAC6FD.7090505@egenix.com> <56CAFBB5.8080503@ntoll.org> <20160222133251.1d1f37a4@ghostwheel> <56CB03E3.6010203@ntoll.org> <56CB6866.2090600@mathforge.org> Message-ID: So over serial maybe, with a PC client listening in? On Mon, 22 Feb 2016 8:05 pm Loop Space wrote: > I second this. > > One use of Bluetooth would be to get information off the microbit and > onto a computer. All processing could be done by the computer so the > microbit wouldn't have to have extensive capabilities. This would still > be possible with reduced capability, if such were possible. > > Andrew > > On 22/02/2016 13:03, Richards, Martin (PUT) wrote: > > I read the note about the Bluetooth stack taking up 12KB. Would it > ever be possible to have any Bluetooth functions with microPython ? > > > > Is there anyway of adapting the implementation for it to use a much > reduced memory store? Eg. By having very restricted limited on the size of > programs run, or the size of lists and data within the program? > > > > I understand that when the Python is compliled, much larger assembly is > produced, but surely this could be limited in some way? > > > > Martin > > > > -----Original Message----- > > From: Microbit [mailto:microbit-bounces+m.richards= > put.gdst.net at python.org] On Behalf Of Nicholas H.Tollervey > > Sent: 22 February 2016 12:50 > > To: microbit at python.org > > Subject: Re: [Microbit-Python] Pointers on connecting microBit to the > outside world > > > > I'm on it. > > > > N. > > > > On 22/02/16 12:39, Michael wrote: > >> On 22 February 2016 at 12:32, Radomir Dopieralski > >> > wrote: > >> > >> Maybe we could put a "bluetooth" section in the docs, and just put > a > >> notice that it's not available in there. That's where I would look > for > >> it if I wanted to make use of it, anyways. > >> > >> > >> I think that's a great suggestion for what it's worth. > >> > >> > >> Michael. > >> > >> > >> > >> _______________________________________________ > >> Microbit mailing list > >> Microbit at python.org > >> https://mail.python.org/mailman/listinfo/microbit > >> > > > > > > ________________________________ > > > > Important Notice > > > > > > This message and any files transmitted with it are confidential to the > addressee. > > If you are not the intended recipient, any disclosure copying or > distribution is > > prohibited and may be unlawful.You should notify the sender immediately > > and delete this message and any attachments without retaining a copy. > > > > Please note that any views or opinions expressed in this message are > solely > > those of the author and may not represent those of the Company or School. > > No liability is accepted by The Girls' Day School Trust for any loss or > damage > > incurred through use of this e-mail. > > > > The Girls' Day School Trust. A limited company Registered in England No. > 6400 > > Registered Charity No. 306983. Registered Office: 100 Rochester Row, > London SW1P 1JP > > > > ________________________________ > > _______________________________________________ > > 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 chris at chrisarndt.de Thu Feb 25 14:17:10 2016 From: chris at chrisarndt.de (Christopher Arndt) Date: Thu, 25 Feb 2016 20:17:10 +0100 Subject: [Microbit-Python] Max recursion depth limit Message-ID: <56CF5336.1000800@chrisarndt.de> Hi all, participating in the micro:bit world tour I currently have a micro:bit at home and am experimenting with MIDI output, which generally works very well (using a minimal circuit with just two resistors and a MID output socket). However, as my scripts got more complex, I encountered "maximum recursion depth exceeded" errors, for example: Traceback (most recent call last): File "__main__", line 125, in File "__main__", line 102, in play File "__main__", line 96, in play File "__main__", line 75, in playstep File "__main__", line 20, in note_on File "__main__", line 18, in channel_message File "__main__", line 14, in send RuntimeError: maximum recursion depth exceeded Is the Python call stack really limited to only that few levels? Does it have a fixed depth or does it depend on the type and size of objects used as function params? Chris -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 979 bytes Desc: OpenPGP digital signature URL: From chris at chrisarndt.de Thu Feb 25 14:33:37 2016 From: chris at chrisarndt.de (Christopher Arndt) Date: Thu, 25 Feb 2016 20:33:37 +0100 Subject: [Microbit-Python] User modules? Message-ID: <56CF5711.50101@chrisarndt.de> Is there any possibility to modularize MicroPython code for the micro:bit? Since there isn't a flash file system, I guess there's no way to store user modules. Or is there a way to embed additional modules into the firmware? Chris -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 979 bytes Desc: OpenPGP digital signature URL: From sparks.m at gmail.com Thu Feb 25 16:21:18 2016 From: sparks.m at gmail.com (Michael) Date: Thu, 25 Feb 2016 21:21:18 +0000 Subject: [Microbit-Python] Max recursion depth limit In-Reply-To: <56CF5336.1000800@chrisarndt.de> References: <56CF5336.1000800@chrisarndt.de> Message-ID: Could you put the code into a pastebin? (or if short post here) ie http://pastebin.com/ (or similar) Regards, Michael. On 25 February 2016 at 19:17, Christopher Arndt wrote: > Hi all, > > participating in the micro:bit world tour I currently have a micro:bit > at home and am experimenting with MIDI output, which generally works > very well (using a minimal circuit with just two resistors and a MID > output socket). > > However, as my scripts got more complex, I encountered "maximum > recursion depth exceeded" errors, for example: > > Traceback (most recent call last): > File "__main__", line 125, in > File "__main__", line 102, in play > File "__main__", line 96, in play > File "__main__", line 75, in playstep > File "__main__", line 20, in note_on > File "__main__", line 18, in channel_message > File "__main__", line 14, in send > RuntimeError: maximum recursion depth exceeded > > Is the Python call stack really limited to only that few levels? Does it > have a fixed depth or does it depend on the type and size of objects > used as function params? > > > Chris > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chris at chrisarndt.de Thu Feb 25 16:34:45 2016 From: chris at chrisarndt.de (Christopher Arndt) Date: Thu, 25 Feb 2016 22:34:45 +0100 Subject: [Microbit-Python] Max recursion depth limit In-Reply-To: References: <56CF5336.1000800@chrisarndt.de> Message-ID: <56CF7375.8070106@chrisarndt.de> Am 25.02.2016 um 22:21 schrieb Michael: > Could you put the code into a pastebin? (or if short post here) If you look at this script at line 20: https://github.com/SpotlightKid/microbit-worldtour-monifa/blob/master/mididrumbox.py#L20 I originally had an additional method in the MidiOut class: def send(self, msg): return self.device.write(bytes(msg)) If I then replace the last line in the "channel_message" method with "self.send(msg)", I get the recursion max depth exceeded error. Chris -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 979 bytes Desc: OpenPGP digital signature URL: From damien.p.george at gmail.com Thu Feb 25 16:29:56 2016 From: damien.p.george at gmail.com (Damien George) Date: Thu, 25 Feb 2016 21:29:56 +0000 Subject: [Microbit-Python] Max recursion depth limit In-Reply-To: References: <56CF5336.1000800@chrisarndt.de> Message-ID: Yes, the recursion depth is really limited. Each call uses about 200 bytes of stack, plus 4 bytes for each argument or local variable. Since there's only 2k of stack (some of which is taken by the start up code), you only get about 8 nested calls. The microbit is really limited on memory, so please don't expect too much from it! There is one thing that can be done about recursion depth: we can enable "stackless mode" whereby the Python function calls use the heap to store args and local variables. That would allow a lot more depth in recursion. But it makes the code run a bit slower. It'd need some testing. On Thu, Feb 25, 2016 at 9:21 PM, Michael wrote: > Could you put the code into a pastebin? (or if short post here) > > ie http://pastebin.com/ (or similar) > > Regards, > > > Michael. > > On 25 February 2016 at 19:17, Christopher Arndt wrote: >> >> Hi all, >> >> participating in the micro:bit world tour I currently have a micro:bit >> at home and am experimenting with MIDI output, which generally works >> very well (using a minimal circuit with just two resistors and a MID >> output socket). >> >> However, as my scripts got more complex, I encountered "maximum >> recursion depth exceeded" errors, for example: >> >> Traceback (most recent call last): >> File "__main__", line 125, in >> File "__main__", line 102, in play >> File "__main__", line 96, in play >> File "__main__", line 75, in playstep >> File "__main__", line 20, in note_on >> File "__main__", line 18, in channel_message >> File "__main__", line 14, in send >> RuntimeError: maximum recursion depth exceeded >> >> Is the Python call stack really limited to only that few levels? Does it >> have a fixed depth or does it depend on the type and size of objects >> used as function params? >> >> >> Chris >> >> >> _______________________________________________ >> 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 chris at chrisarndt.de Thu Feb 25 17:07:48 2016 From: chris at chrisarndt.de (Christopher Arndt) Date: Thu, 25 Feb 2016 23:07:48 +0100 Subject: [Microbit-Python] Max recursion depth limit In-Reply-To: References: <56CF5336.1000800@chrisarndt.de> Message-ID: <56CF7B34.409@chrisarndt.de> Am 25.02.2016 um 22:29 schrieb Damien George: > Yes, the recursion depth is really limited. Ok, thanks for the explanation. > The microbit is really limited on memory, so please don't expect too > much from it! Yeah, I wasn't really aware that it so limited. Kinda stinks, but luckily there are enough other MicroPython boards out there. Chris -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 979 bytes Desc: OpenPGP digital signature URL: From microbit at sheep.art.pl Thu Feb 25 17:11:55 2016 From: microbit at sheep.art.pl (Radomir Dopieralski) Date: Thu, 25 Feb 2016 23:11:55 +0100 Subject: [Microbit-Python] Max recursion depth limit In-Reply-To: <56CF7B34.409@chrisarndt.de> References: <56CF5336.1000800@chrisarndt.de> <56CF7B34.409@chrisarndt.de> Message-ID: <20160225231155.20bbd76d@ghostwheel> On Thu, 25 Feb 2016 23:07:48 +0100 Christopher Arndt wrote: > Am 25.02.2016 um 22:29 schrieb Damien George: > > Yes, the recursion depth is really limited. > > Ok, thanks for the explanation. > > > The microbit is really limited on memory, so please don't expect too > > much from it! > > Yeah, I wasn't really aware that it so limited. Kinda stinks, but > luckily there are enough other MicroPython boards out there. Note that all implementations of Python (at least all that I am aware of) witll raise this exception if you go too deep into the call stack. I think CPython has this limit set to 100 by default, but you can change it. The reasoning behind this is that in the procedural programming style that Python was created for, such deep recursion is usually a sign of the code going wild, and not an intentional thing. -- Radomir Dopieralski From ntoll at ntoll.org Fri Feb 26 03:04:32 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Fri, 26 Feb 2016 08:04:32 +0000 Subject: [Microbit-Python] March 22nd Message-ID: <56D00710.4090907@ntoll.org> Folks, Just a FYI. That's the date when 1 million devices start arriving in schools. It'll take a few weeks to deliver them all. ;-) I'm pushing the BBC *hard* to get the web-based editor into TouchDevelop. There is certainly no impediment from our side of things and Monday will be an important day since one of the key decision makers returns from holiday. N. From mal at egenix.com Fri Feb 26 04:37:01 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Fri, 26 Feb 2016 10:37:01 +0100 Subject: [Microbit-Python] User modules? In-Reply-To: <56CF5711.50101@chrisarndt.de> References: <56CF5711.50101@chrisarndt.de> Message-ID: <56D01CBD.5030801@egenix.com> On 25.02.2016 20:33, Christopher Arndt wrote: > Is there any possibility to modularize MicroPython code for the micro:bit? > > Since there isn't a flash file system, I guess there's no way to store > user modules. Or is there a way to embed additional modules into the > firmware? We had discussed this a few weeks ago. It should be possible to the uflash tool to combine several modules into one and then playing a few tricks to get the namespaces right. MicroPython appears to be using classes for the module namespaces, so putting the code into a class wrapper appears to be a good solution for the namespaces: >>> import music >>> type(music) All that said, I don't know how much flash memory is available for Python scripts, and of course, the memory constraints don't allow for many code objects to exist anyway. The 32kB retail version of the MB should reduce the latter problem a bit. Perhaps Cython could be used to compile Python modules into C and then have those added to the firmware when flashing the MB. That should reduce the code object overhead. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Feb 26 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/ ________________________________________________________________________ 2016-02-19: Released eGenix PyRun 2.1.2 ... http://egenix.com/go88 ::: 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 joe.t.glancy at gmail.com Fri Feb 26 05:58:05 2016 From: joe.t.glancy at gmail.com (Joe Glancy) Date: Fri, 26 Feb 2016 10:58:05 +0000 Subject: [Microbit-Python] User modules? In-Reply-To: <56D01CBD.5030801@egenix.com> References: <56CF5711.50101@chrisarndt.de> <56D01CBD.5030801@egenix.com> Message-ID: You can make your own modules in C/C++ using one of the existing modules as guidance. It's (almost) as simple as creating a couple of files and adding your module to a few files. On Fri, 26 Feb 2016 9:37 am M.-A. Lemburg wrote: > On 25.02.2016 20:33, Christopher Arndt wrote: > > Is there any possibility to modularize MicroPython code for the > micro:bit? > > > > Since there isn't a flash file system, I guess there's no way to store > > user modules. Or is there a way to embed additional modules into the > > firmware? > > We had discussed this a few weeks ago. It should be possible > to the uflash tool to combine several modules into one and > then playing a few tricks to get the namespaces right. > > MicroPython appears to be using classes for the module namespaces, > so putting the code into a class wrapper appears to be a good > solution for the namespaces: > > >>> import music > >>> type(music) > > > All that said, I don't know how much flash memory is available > for Python scripts, and of course, the memory constraints don't > allow for many code objects to exist anyway. The 32kB retail > version of the MB should reduce the latter problem a bit. > > Perhaps Cython could be used to compile Python modules into > C and then have those added to the firmware when flashing the > MB. That should reduce the code object overhead. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Experts (#1, Feb 26 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/ > ________________________________________________________________________ > 2016-02-19: Released eGenix PyRun 2.1.2 ... http://egenix.com/go88 > > ::: 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 Fri Feb 26 18:34:03 2016 From: damien.p.george at gmail.com (Damien George) Date: Fri, 26 Feb 2016 23:34:03 +0000 Subject: [Microbit-Python] User modules? In-Reply-To: References: <56CF5711.50101@chrisarndt.de> <56D01CBD.5030801@egenix.com> Message-ID: There is now (experimental) support for frozen bytecode, where your .py file is compiled offline and then frozen into the firmware when the firmware is built. This approach does not use any RAM (just flash). But it requires compiling the firmware each time you change the module. This stuff is pretty advanced, probably out of scope of the microbit. On Fri, Feb 26, 2016 at 10:58 AM, Joe Glancy wrote: > You can make your own modules in C/C++ using one of the existing modules as > guidance. It's (almost) as simple as creating a couple of files and adding > your module to a few files. > > > On Fri, 26 Feb 2016 9:37 am M.-A. Lemburg wrote: >> >> On 25.02.2016 20:33, Christopher Arndt wrote: >> > Is there any possibility to modularize MicroPython code for the >> > micro:bit? >> > >> > Since there isn't a flash file system, I guess there's no way to store >> > user modules. Or is there a way to embed additional modules into the >> > firmware? >> >> We had discussed this a few weeks ago. It should be possible >> to the uflash tool to combine several modules into one and >> then playing a few tricks to get the namespaces right. >> >> MicroPython appears to be using classes for the module namespaces, >> so putting the code into a class wrapper appears to be a good >> solution for the namespaces: >> >> >>> import music >> >>> type(music) >> >> >> All that said, I don't know how much flash memory is available >> for Python scripts, and of course, the memory constraints don't >> allow for many code objects to exist anyway. The 32kB retail >> version of the MB should reduce the latter problem a bit. >> >> Perhaps Cython could be used to compile Python modules into >> C and then have those added to the firmware when flashing the >> MB. That should reduce the code object overhead. >> >> -- >> Marc-Andre Lemburg >> eGenix.com >> >> Professional Python Services directly from the Experts (#1, Feb 26 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/ >> ________________________________________________________________________ >> 2016-02-19: Released eGenix PyRun 2.1.2 ... http://egenix.com/go88 >> >> ::: 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 andy.crook at gmail.com Sat Feb 27 04:58:42 2016 From: andy.crook at gmail.com (Andy Crook) Date: Sat, 27 Feb 2016 09:58:42 +0000 Subject: [Microbit-Python] Software discussion? Message-ID: Hi, First post. Don't kill me. I'm a physics teacher in Newbury pulled into computer science because I'm a coding nerd, arduino, rasppi, that kind of thing. I got my hands on a microbit last week, and have written a couple of games for it. The mailing list here seems focussed on the hardware and interfaces. Is there a specific place for python related software discussion? I'd like to know what other people are up to with it. Cheers! Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.grandi at gmail.com Sat Feb 27 05:24:58 2016 From: a.grandi at gmail.com (a.grandi at gmail.com) Date: Sat, 27 Feb 2016 10:24:58 +0000 Subject: [Microbit-Python] Software discussion? In-Reply-To: References: Message-ID: Hi Andy and welcome to the mailing list :) This list is not limited to hardware discussion, and any other micro:bit related topic is more than welcome. Feel free to share your experiments, your questions etc... with the rest of the list. I also suggest you (if you haven't done it already) to share your source code on GitHub, with an appropriate license (for example MIT), so that other teachers, developers etc... can take inspiration and produce other examples. Thank you so much, cheers p.s: I don't know if I'm too "old style", but I really liked the time when it was people to propose the contents. I mean: it would be amazing if we have something like "Planet micro:bit", a website that syndicate other people blogs and collect all micro:bit related posts (something like Planet Ubuntu http://planet.ubuntu.com ) You can find mine here: https://www.andreagrandi.it/category/microbit/ On 27 February 2016 at 09:58, Andy Crook wrote: > Hi, > > First post. Don't kill me. I'm a physics teacher in Newbury pulled into > computer science because I'm a coding nerd, arduino, rasppi, that kind of > thing. > > I got my hands on a microbit last week, and have written a couple of games > for it. The mailing list here seems focussed on the hardware and interfaces. > Is there a specific place for python related software discussion? I'd like > to know what other people are up to with it. > > Cheers! > > Andy > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -- Andrea Grandi - Software Engineer Website: https://www.andreagrandi.it Twitter: https://twitter.com/andreagrandi GitHub: https://github.com/andreagrandi PGP: 7238 74F6 886D 5994 323F 1781 8CFB 47AD C384 F0CC From nevil.hunt at hotmail.co.uk Sat Feb 27 07:29:18 2016 From: nevil.hunt at hotmail.co.uk (Nevil Hunt) Date: Sat, 27 Feb 2016 12:29:18 +0000 Subject: [Microbit-Python] Software discussion? In-Reply-To: References: , Message-ID: Hi Andy, It's good to hear from someone else in Berkshire! I live near Reading and have done Raspberry Pi Python Workshops at Kennet School in Thatcham plus Blewbury & Cholsey Primary Schools In case you are interested Steve who I met at the Oxford Code Club Meetup on Tuesday is hosting an event in Thatcham in a few weeks. Below are the details in case they are of interest to you (or anyone else in the area!). I will be there showing my Raspberry Pi Kits, Kitronik's Inventor's Kit for the micro:bit and prototype versions of my micro:bit resources Nevil Nevil Hunt STEM Ambassador ----- Dear Ladies / Gents My name is Stephen Manson and I am the code club leader for Bucklebury Primary School. We are nationaly recognised as a star code club and are constantly looking for ways to promote code club in our local area. (https://www.codeclub.org.uk/star-clubs/visit/bucklebury) An evening event for teachers who are teaching coding in schools or for interested potential codeclub leaders is being organised for the 17th March 2016 at the cricket club in Thatcham. The purpose of the event is for us all to meet exchange ideas and make contact with others who are interested in teaching coding at school. Also some vendors who market equipment will be invited to join us to demonstrate their wares and a few talks by other existing code club leaders. A small cost of ?5 per person will be levied due to hire cost of the venue and to cover food etc. Pizza (or other nibbles) will be made available along with the bar being available. https://www.eventbrite.co.uk/e/thatcham-code-evening-tickets-19636176332 Please pass this message on to anyone whom you think would like to come along as I'm sure it will be a fun and informative event for everyone. Many thanks Steve Manson ------ > Date: Sat, 27 Feb 2016 10:24:58 +0000 > From: a.grandi at gmail.com > To: microbit at python.org > Subject: Re: [Microbit-Python] Software discussion? > > Hi Andy and welcome to the mailing list :) > > This list is not limited to hardware discussion, and any other > micro:bit related topic is more than welcome. > Feel free to share your experiments, your questions etc... with the > rest of the list. > > I also suggest you (if you haven't done it already) to share your > source code on GitHub, with an appropriate license (for example MIT), > so that other teachers, developers etc... can take inspiration and > produce other examples. > > Thank you so much, cheers > > p.s: I don't know if I'm too "old style", but I really liked the time > when it was people to propose the contents. I mean: it would be > amazing if we have something like "Planet micro:bit", a website that > syndicate other people blogs and collect all micro:bit related posts > (something like Planet Ubuntu http://planet.ubuntu.com ) > You can find mine here: https://www.andreagrandi.it/category/microbit/ > > > On 27 February 2016 at 09:58, Andy Crook wrote: > > Hi, > > > > First post. Don't kill me. I'm a physics teacher in Newbury pulled into > > computer science because I'm a coding nerd, arduino, rasppi, that kind of > > thing. > > > > I got my hands on a microbit last week, and have written a couple of games > > for it. The mailing list here seems focussed on the hardware and interfaces. > > Is there a specific place for python related software discussion? I'd like > > to know what other people are up to with it. > > > > Cheers! > > > > Andy > > _______________________________________________ > > Microbit mailing list > > Microbit at python.org > > https://mail.python.org/mailman/listinfo/microbit > > > > > > -- > Andrea Grandi - Software Engineer > Website: https://www.andreagrandi.it > Twitter: https://twitter.com/andreagrandi > GitHub: https://github.com/andreagrandi > PGP: 7238 74F6 886D 5994 323F 1781 8CFB 47AD C384 F0CC > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit -------------- next part -------------- An HTML attachment was scrubbed... URL: From joakim.pettersson at join.se Mon Feb 29 03:38:47 2016 From: joakim.pettersson at join.se (Joakim Pettersson) Date: Mon, 29 Feb 2016 08:38:47 +0000 Subject: [Microbit-Python] Max recursion depth limit In-Reply-To: Message-ID: Hi Damien, I would like stackless - to allow deeper recursion and more paralell tasks, but also for cloning and migrating services with such recursions/tasks. BR/Joakim ------ Originalmeddelande ------ Fr?n: "Damien George" Till: "For Pythonic MicroBit related discussions" Skickat: 2016-02-25 22:29:56 ?mne: Re: [Microbit-Python] Max recursion depth limit >Yes, the recursion depth is really limited. Each call uses about 200 >bytes of stack, plus 4 bytes for each argument or local variable. >Since there's only 2k of stack (some of which is taken by the start up >code), you only get about 8 nested calls. > >The microbit is really limited on memory, so please don't expect too >much from it! > >There is one thing that can be done about recursion depth: we can >enable "stackless mode" whereby the Python function calls use the heap >to store args and local variables. That would allow a lot more depth >in recursion. But it makes the code run a bit slower. It'd need some >testing. > > >On Thu, Feb 25, 2016 at 9:21 PM, Michael wrote: >> Could you put the code into a pastebin? (or if short post here) >> >> ie http://pastebin.com/ (or similar) >> >> Regards, >> >> >> Michael. >> >> On 25 February 2016 at 19:17, Christopher Arndt >>wrote: >>> >>> Hi all, >>> >>> participating in the micro:bit world tour I currently have a >>>micro:bit >>> at home and am experimenting with MIDI output, which generally works >>> very well (using a minimal circuit with just two resistors and a MID >>> output socket). >>> >>> However, as my scripts got more complex, I encountered "maximum >>> recursion depth exceeded" errors, for example: >>> >>> Traceback (most recent call last): >>> File "__main__", line 125, in >>> File "__main__", line 102, in play >>> File "__main__", line 96, in play >>> File "__main__", line 75, in playstep >>> File "__main__", line 20, in note_on >>> File "__main__", line 18, in channel_message >>> File "__main__", line 14, in send >>> RuntimeError: maximum recursion depth exceeded >>> >>> Is the Python call stack really limited to only that few levels? >>>Does it >>> have a fixed depth or does it depend on the type and size of objects >>> used as function params? >>> >>> >>> Chris >>> >>> >>> _______________________________________________ >>> 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 >> >_______________________________________________ >Microbit mailing list >Microbit at python.org >https://mail.python.org/mailman/listinfo/microbit From joe.t.glancy at gmail.com Mon Feb 29 04:24:01 2016 From: joe.t.glancy at gmail.com (Joe Glancy) Date: Mon, 29 Feb 2016 09:24:01 +0000 Subject: [Microbit-Python] Software discussion? In-Reply-To: References: Message-ID: We could have a uBit stack exchange :D On Sat, 27 Feb 2016 12:30 pm Nevil Hunt wrote: > Hi Andy, > > It's good to hear from someone else in Berkshire! > I live near Reading and have done Raspberry Pi Python Workshops at Kennet > School in Thatcham plus Blewbury & Cholsey Primary Schools > > In case you are interested Steve who I met at the Oxford Code Club Meetup > on Tuesday is hosting an event in Thatcham in a few weeks. Below are the > details in case they are of interest to you (or anyone else in the area!). > I will be there showing my Raspberry Pi Kits, Kitronik's Inventor's Kit for > the micro:bit and prototype versions of my micro:bit resources > > Nevil > > > *Nevil Hunt* > *STEM Ambassador* > > > ----- > Dear Ladies / Gents > > My name is Stephen Manson and I am the code club leader for Bucklebury > Primary School. We are nationaly recognised as a star code club and are > constantly looking for ways to promote code club in our local area. ( > https://www.codeclub.org.uk/star-clubs/visit/bucklebury) > > An evening event for teachers who are teaching coding in schools or for > interested potential codeclub leaders is being organised for the 17th March > 2016 at the cricket club in Thatcham. The purpose of the event is for us > all to meet exchange ideas and make contact with others who are interested > in teaching coding at school. Also some vendors who market equipment will > be invited to join us to demonstrate their wares and a few talks by other > existing code club leaders. > > A small cost of ?5 per person will be levied due to hire cost of the venue > and to cover food etc. Pizza (or other nibbles) will be made available > along with the bar being available. > > https://www.eventbrite.co.uk/e/thatcham-code-evening-tickets-19636176332 > > Please pass this message on to anyone whom you think would like to come > along as I'm sure it will be a fun and informative event for everyone. > > Many thanks > > Steve Manson > ------ > > > Date: Sat, 27 Feb 2016 10:24:58 +0000 > > From: a.grandi at gmail.com > > To: microbit at python.org > > Subject: Re: [Microbit-Python] Software discussion? > > > > > Hi Andy and welcome to the mailing list :) > > > > This list is not limited to hardware discussion, and any other > > micro:bit related topic is more than welcome. > > Feel free to share your experiments, your questions etc... with the > > rest of the list. > > > > I also suggest you (if you haven't done it already) to share your > > source code on GitHub, with an appropriate license (for example MIT), > > so that other teachers, developers etc... can take inspiration and > > produce other examples. > > > > Thank you so much, cheers > > > > p.s: I don't know if I'm too "old style", but I really liked the time > > when it was people to propose the contents. I mean: it would be > > amazing if we have something like "Planet micro:bit", a website that > > syndicate other people blogs and collect all micro:bit related posts > > (something like Planet Ubuntu http://planet.ubuntu.com ) > > You can find mine here: https://www.andreagrandi.it/category/microbit/ > > > > > > On 27 February 2016 at 09:58, Andy Crook wrote: > > > Hi, > > > > > > First post. Don't kill me. I'm a physics teacher in Newbury pulled into > > > computer science because I'm a coding nerd, arduino, rasppi, that kind > of > > > thing. > > > > > > I got my hands on a microbit last week, and have written a couple of > games > > > for it. The mailing list here seems focussed on the hardware and > interfaces. > > > Is there a specific place for python related software discussion? I'd > like > > > to know what other people are up to with it. > > > > > > Cheers! > > > > > > Andy > > > _______________________________________________ > > > Microbit mailing list > > > Microbit at python.org > > > https://mail.python.org/mailman/listinfo/microbit > > > > > > > > > > > -- > > Andrea Grandi - Software Engineer > > Website: https://www.andreagrandi.it > > Twitter: https://twitter.com/andreagrandi > > GitHub: https://github.com/andreagrandi > > PGP: 7238 74F6 886D 5994 323F 1781 8CFB 47AD C384 F0CC > > _______________________________________________ > > 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 damien.p.george at gmail.com Mon Feb 29 05:09:49 2016 From: damien.p.george at gmail.com (Damien George) Date: Mon, 29 Feb 2016 10:09:49 +0000 Subject: [Microbit-Python] Max recursion depth limit In-Reply-To: References: Message-ID: Hi Joakim, Did you run into the recusion depth limit yourself in a realistic script? If so then maybe you can explain what your script does so I can understand the problem better. I don't know what you mean by "parallel tasks", and neither "cloning and migration". Regards, Damien. On Mon, Feb 29, 2016 at 8:38 AM, Joakim Pettersson wrote: > Hi Damien, I would like stackless - to allow deeper recursion and more > paralell tasks, but also for cloning and migrating services with such > recursions/tasks. BR/Joakim > > ------ Originalmeddelande ------ > Fr?n: "Damien George" > Till: "For Pythonic MicroBit related discussions" > Skickat: 2016-02-25 22:29:56 > ?mne: Re: [Microbit-Python] Max recursion depth limit > > >> Yes, the recursion depth is really limited. Each call uses about 200 >> bytes of stack, plus 4 bytes for each argument or local variable. >> Since there's only 2k of stack (some of which is taken by the start up >> code), you only get about 8 nested calls. >> >> The microbit is really limited on memory, so please don't expect too >> much from it! >> >> There is one thing that can be done about recursion depth: we can >> enable "stackless mode" whereby the Python function calls use the heap >> to store args and local variables. That would allow a lot more depth >> in recursion. But it makes the code run a bit slower. It'd need some >> testing. >> >> >> On Thu, Feb 25, 2016 at 9:21 PM, Michael wrote: >>> >>> Could you put the code into a pastebin? (or if short post here) >>> >>> ie http://pastebin.com/ (or similar) >>> >>> Regards, >>> >>> >>> Michael. >>> >>> On 25 February 2016 at 19:17, Christopher Arndt >>> wrote: >>>> >>>> >>>> Hi all, >>>> >>>> participating in the micro:bit world tour I currently have a micro:bit >>>> at home and am experimenting with MIDI output, which generally works >>>> very well (using a minimal circuit with just two resistors and a MID >>>> output socket). >>>> >>>> However, as my scripts got more complex, I encountered "maximum >>>> recursion depth exceeded" errors, for example: >>>> >>>> Traceback (most recent call last): >>>> File "__main__", line 125, in >>>> File "__main__", line 102, in play >>>> File "__main__", line 96, in play >>>> File "__main__", line 75, in playstep >>>> File "__main__", line 20, in note_on >>>> File "__main__", line 18, in channel_message >>>> File "__main__", line 14, in send >>>> RuntimeError: maximum recursion depth exceeded >>>> >>>> Is the Python call stack really limited to only that few levels? Does >>>> it >>>> have a fixed depth or does it depend on the type and size of objects >>>> used as function params? >>>> >>>> >>>> Chris >>>> >>>> >>>> _______________________________________________ >>>> 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 >>> >> _______________________________________________ >> 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 joakim.pettersson at join.se Mon Feb 29 08:13:56 2016 From: joakim.pettersson at join.se (Joakim Pettersson) Date: Mon, 29 Feb 2016 13:13:56 +0000 Subject: [Microbit-Python] Max recursion depth limit In-Reply-To: Message-ID: Hi Damien, Maybe this is far to technical for this list but here goes an attempt to explain what I am after: An example (the code now belongs to a customer so I can just explain): A push-button (callback function) was controlling a timer action (another callback function) on a MicroPython pyboard v1.0. The push-button function read a stepper function and its parameters from a schedule, while the timer function simultaneously stepped the light intensity in an RGB-ring using that function and parameters. The first attempt used the heap, did not check for re-entrant triggering (button glitches), and had several call levels. Then I found out that callbacks can't use heap and might allocate too much stack if not served in time. So I moved out the heap allocation by using global variables, added early exit by checking if a button push is already being served, and flattened the code to at most two call levels in both callbacks. Then it worked like a charm - rock solid and with zero jitter - very impressing when considering that it is a single interpreter that does all the job! I have a hunch either callback's won't work at all or won't have the limitations I bumped into above, when implemented on stackless. Do you agree? "Parallel tasks" examples - a socket server trying to serve many sensors in a mesh network, a callback trying to serve many neurons in a spiky sensor, or any service trying to serve many users simultaneously. It would be nice to have some more margin before having to resort to sequential or blocking operation. "Cloning and migration" example - a service running on one stackless interpreter has too many users or is too far from some of them, and therefore need to move away some of its tasks to another interpreter. To do that, it must first copy their code and heap ("clone") to the other stackless interpreter and then switch execution to that clone instead of the original ("migration"). All these real-time callback functions we have now in MicroPython is pretty much not doable at all in a standard python on linux or PC - it woud be really cool to expand a bit more on it and make it even more flexible! Best regards - and with highest admirations for your work, /Joakim ------ Originalmeddelande ------ Fr?n: "Damien George" Till: "Joakim Pettersson" ; "For Pythonic MicroBit related discussions" Skickat: 2016-02-29 11:09:49 ?mne: Re: [Microbit-Python] Max recursion depth limit >Hi Joakim, > >Did you run into the recusion depth limit yourself in a realistic >script? If so then maybe you can explain what your script does so I >can understand the problem better. > >I don't know what you mean by "parallel tasks", and neither "cloning >and migration". > >Regards, >Damien. > > >On Mon, Feb 29, 2016 at 8:38 AM, Joakim Pettersson > wrote: >> Hi Damien, I would like stackless - to allow deeper recursion and >>more >> paralell tasks, but also for cloning and migrating services with such >> recursions/tasks. BR/Joakim >> >> ------ Originalmeddelande ------ >> Fr?n: "Damien George" >> Till: "For Pythonic MicroBit related discussions" >> >> Skickat: 2016-02-25 22:29:56 >> ?mne: Re: [Microbit-Python] Max recursion depth limit >> >> >>> Yes, the recursion depth is really limited. Each call uses about >>>200 >>> bytes of stack, plus 4 bytes for each argument or local variable. >>> Since there's only 2k of stack (some of which is taken by the start >>>up >>> code), you only get about 8 nested calls. >>> >>> The microbit is really limited on memory, so please don't expect too >>> much from it! >>> >>> There is one thing that can be done about recursion depth: we can >>> enable "stackless mode" whereby the Python function calls use the >>>heap >>> to store args and local variables. That would allow a lot more >>>depth >>> in recursion. But it makes the code run a bit slower. It'd need >>>some >>> testing. >>> >>> >>> On Thu, Feb 25, 2016 at 9:21 PM, Michael wrote: >>>> >>>> Could you put the code into a pastebin? (or if short post here) >>>> >>>> ie http://pastebin.com/ (or similar) >>>> >>>> Regards, >>>> >>>> >>>> Michael. >>>> >>>> On 25 February 2016 at 19:17, Christopher Arndt >>>> >>>> wrote: >>>>> >>>>> >>>>> Hi all, >>>>> >>>>> participating in the micro:bit world tour I currently have a >>>>>micro:bit >>>>> at home and am experimenting with MIDI output, which generally >>>>>works >>>>> very well (using a minimal circuit with just two resistors and a >>>>>MID >>>>> output socket). >>>>> >>>>> However, as my scripts got more complex, I encountered "maximum >>>>> recursion depth exceeded" errors, for example: >>>>> >>>>> Traceback (most recent call last): >>>>> File "__main__", line 125, in >>>>> File "__main__", line 102, in play >>>>> File "__main__", line 96, in play >>>>> File "__main__", line 75, in playstep >>>>> File "__main__", line 20, in note_on >>>>> File "__main__", line 18, in channel_message >>>>> File "__main__", line 14, in send >>>>> RuntimeError: maximum recursion depth exceeded >>>>> >>>>> Is the Python call stack really limited to only that few levels? >>>>>Does >>>>> it >>>>> have a fixed depth or does it depend on the type and size of >>>>>objects >>>>> used as function params? >>>>> >>>>> >>>>> Chris >>>>> >>>>> >>>>> _______________________________________________ >>>>> 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 >>>> >>> _______________________________________________ >>> 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 andy.crook at gmail.com Mon Feb 29 08:18:35 2016 From: andy.crook at gmail.com (Andy Crook) Date: Mon, 29 Feb 2016 13:18:35 +0000 Subject: [Microbit-Python] Python game - Tilt v1.1 Message-ID: Hi, As suggested I've uploaded my first python game for the microbit to github: https://github.com/andycrook/micro-bit-python-game-Tilt It's nothing to set the world on fire, but I'm reasonably happy with how it turned out. Cheers! Andy -------------- next part -------------- An HTML attachment was scrubbed... URL: