From sventurnau at yahoo.com Fri Dec 2 22:10:00 2016 From: sventurnau at yahoo.com (Sven Turnau) Date: Sat, 3 Dec 2016 03:10:00 +0000 (UTC) Subject: [Microbit-Python] 8-Ohm; 1W speaker References: <95560687.5009722.1480734600401.ref@mail.yahoo.com> Message-ID: <95560687.5009722.1480734600401@mail.yahoo.com> May I connect the 8-Ohm; 1W speaker to Ground & pin 0.Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mal at egenix.com Sat Dec 3 05:50:33 2016 From: mal at egenix.com (M.-A. Lemburg) Date: Sat, 3 Dec 2016 11:50:33 +0100 Subject: [Microbit-Python] 8-Ohm; 1W speaker In-Reply-To: <95560687.5009722.1480734600401@mail.yahoo.com> References: <95560687.5009722.1480734600401.ref@mail.yahoo.com> <95560687.5009722.1480734600401@mail.yahoo.com> Message-ID: <04985f99-322c-5b6f-a17c-9f439d9603e0@egenix.com> On 03.12.2016 04:10, Sven Turnau via Microbit wrote: > May I connect the 8-Ohm; 1W speaker to Ground & pin 0.Thank You. I cannot say whether this would work - it may well break your microbit due to the low impedance of the speaker. I have only tried connecting a headphone so far and this worked well with the speech API: http://microbit-micropython.readthedocs.io/en/latest/tutorials/speech.html (you need the most recent MicroPython version to get this working) Here's a guide for connecting headphones: https://www.microbit.co.uk/blocks/lessons/hack-your-headphones/activity A simple bluetooth speaker with headphone plug should work as well. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Experts (#1, Dec 03 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 danka.miklos at gmail.com Sun Dec 4 06:58:56 2016 From: danka.miklos at gmail.com (=?UTF-8?B?TWlrbMOzcyBBbmRyw6FzIERhbmth?=) Date: Sun, 04 Dec 2016 11:58:56 +0000 Subject: [Microbit-Python] Microbit Python Doc translation In-Reply-To: References: Message-ID: I think as a first step then, I'll just go ahead and fork the original repository for a translation. If some more advanced process is agreed upon, or the documentation is moved to a new platform, we can always move this first fork as well. Thanks! Miklos On Mon, Nov 28, 2016 at 10:59 PM Mikl?s Andr?s Danka wrote: > Makes a lot more sense! Let me ruminate and explore a bit more. > > -Miklos > > On Mon, Nov 28, 2016 at 10:51 PM Carlos Pereira Atencio < > carlosperate at gmail.com> wrote: > > Readthedocs already offers linked translations, so we can continue using > this platform. As far was what I would be looking for is better support for > translation tracking and updating, so that people could easily do small > contribution without a complex set up or trying to figure out what to > update by manually reading the English and translated documents to spot > unsynchronised bits. I mention some of my concerns with git here: > https://github.com/bbcmicrobit/micropython/pull/371#discussion_r89747053 > > > I feel that ultimately, how live the documentation is in any language will > depend on how active the community is. That's irrespective of the > translation process. No? > > > I wouldn't quite agree with that, we (as the open source community) always > point to documentation, or in this case translations, as an easy first > step. If we make this difficult we might inadvertently be turning away > valuable contributions. I would expect some of this translations to come > also from not-so-technical communities, teachers for instance are great > candidates, and every time I even mention git/github to teachers I never > hear anything even remotely positive (this specific point is just my > personal experience and should be taken completely anecdotally). If we > ignoring the use of git for this solutions, then it would be a very manual > process to keep track of changes. Yes, "edit this on github" and PRs are > easy, and I think it does work great for normal documentation, but > translations are do not really follow the same model and I don't feel like > git really is the best way to manage them. > > > > On 28 November 2016 at 11:19, Mikl?s Andr?s Danka > wrote: > > That's true - all I expected from translations support is that they allow > listing translations together and possibly synchronising pages (so if I'm > on page X and click the other language, I'm taken to the right page). > > What else are you looking for? More fine-grained support? Support for > tracking/translating each English commit? > > I feel that ultimately, how live the documentation is in any language will > depend on how active the community is. That's irrespective of the > translation process. No? > > -Miklos > > On Mon, Nov 28, 2016 at 10:15 PM Carlos Pereira Atencio < > carlosperate at gmail.com> wrote: > > I am not really able to have a proper look until later, but from a very > quick skim gitbook doesn't seem to offer any translation feature to give it > an advantage over readthedocs. They both allow you to add translation to > their document generation, but there isn't any features to be able to > manage and synchronise such translations, no? > > Regards, > Carlos > > On 28 November 2016 at 11:02, Mikl?s Andr?s Danka > wrote: > > An alternative is Gitbook: https://www.gitbook.com/ > > - As far as I can see, it's free for public non-commercial uses > - It supports translations: http://toolchain.gitbook.com/languages.html > - It is non-technical to edit it - git backed, but no need to deal > with git > - For a live example, check out the documentation of Redux: > http://redux.js.org/docs/basics/UsageWithReact.html > > > Do you expect a reasonably quick decision on this? If these discussions > take a longer time, then I think the best solution is if we fork the repo > and start the translation - leaving time to decide the exact process. If > you expect quick agreement, then we can wait until Gitbook or something > else is set up. > > Thoughts? > > -Miklos > > > PS. Nick, thanks for the response! I now requested membership. > > > > > On Sun, Nov 27, 2016 at 11:26 PM Carlos Pereira Atencio < > carlosperate at gmail.com> wrote: > > Let's not forget we still need to formalise the way we create and process > the translations: https://github.com/bbcmicrobit/micropython/pull/371 > There's been some conversation there but not decisions done at all. > > > > On Sun, 27 Nov 2016, 12:13 Nicholas H.Tollervey, wrote: > > Hi Mikl?s, > > Hmmm... I can't find your original email to this mailing list. Also, to > post you need to be a member (you can join here: > https://mail.python.org/mailman/listinfo/microbit) although I get > notified of all the non-member postings so let this one through! Also, > since you're not a member I'm not sure you'll see any replies to the > mailing list (hence me cc'ing you to my reply). > > Regarding translation and ReadTheDocs: it would be wonderful to have > Hungarian translations of the documentation! RtD have started to put > advertising on our documentation and there is also work on the pyedu.io > website for Python in education related resources. > > I wonder if we shouldn't just put our tutorials on there instead (along > with lots of other education related resources)..? > > Thoughts..? > > N. > > > > On 27/11/16 06:03, Mikl?s Andr?s Danka wrote: > > Hi, > > > > I haven't got any responses, so I wanted to ping again before I start > > hosting a fork. > > > > Read The Docs supports localisation in this way: > > http://read-the-docs.readthedocs.io/en/latest/localization.html > > > > Would you up for doing this? > > > > Thanks, > > Miklos > > > > > > On Mon, Oct 31, 2016 at 9:26 PM Mikl?s Andr?s Danka > > > wrote: > > > > Hello, > > > > I'm Miklos Danka, a software engineer and a teacher (here's an > > example > > ). I'm > > writing regarding the BBC Microbit Python edition - please let me > > know if this is not the right place or contact for it. > > > > First of all: *it's really awesome.* Incredible job, especially > > around the documentation, which even less experienced kids > > understood well. Very very cool. > > > > Since I teach kids in Hungary, I wanted to translate the > > documentation > > to > > Hungarian. My question is: *do you have a recommended/preferred way > > of publishing the translation?* I can always just fork the > > repository - but that would miss out on the benefits of having the > > documentations tracked together at the same website. > > Would you recommend it as a Sphinx "version" (next to "latest" and > > "stable")? Or does Sphinx provide and orthogonal translation feature? > > > > Any ideas/suggestions would be very welcome and appreciated. > > > > Thanks! > > Miklos > > > > > > > > _______________________________________________ > > 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 brucepiggott at ntlworld.com Sun Dec 4 06:35:16 2016 From: brucepiggott at ntlworld.com (Piggott BRUCE) Date: Sun, 4 Dec 2016 11:35:16 +0000 (GMT) Subject: [Microbit-Python] 8-Ohm; 1W speaker In-Reply-To: <04985f99-322c-5b6f-a17c-9f439d9603e0@egenix.com> References: <95560687.5009722.1480734600401.ref@mail.yahoo.com> <95560687.5009722.1480734600401@mail.yahoo.com> <04985f99-322c-5b6f-a17c-9f439d9603e0@egenix.com> Message-ID: <383042474.2531319.1480851316338.JavaMail.open-xchange@oxbe3.tb.ukmail.iss.as9143.net> Hi, I have connected an 8 ohm speaker to the microbit outputs from GND to 0 but it requires a resistor to limit the output current. >From the microprocessor spec I get a maximum output current of 100mA and this at 3 volts so by ohms law the minimum load is 30 ohms. Subtract the 8 oms of the speaker and the limiting resistor is 22 ohms. This works albeit at low speaker power. I'm not sure about the maximum output current because another search for this gave a maximum of 5 mA! If this is true then the minimum load would be 600 ohms which would give very little sound output. All I can say is that the 22 ohm series resistor works and doesn't seem to damage the microbit output pin. Hope this helps, Cheers, Bruce > > On 03 December 2016 at 10:50 "M.-A. Lemburg" wrote: > > > On 03.12.2016 04:10, Sven Turnau via Microbit wrote: > > May I connect the 8-Ohm; 1W speaker to Ground & pin 0.Thank You. > > I cannot say whether this would work - it may well break your > microbit due to the low impedance of the speaker. > > I have only tried connecting a headphone so far and this worked > well with the speech API: > > http://microbit-micropython.readthedocs.io/en/latest/tutorials/speech.html > > (you need the most recent MicroPython version to get this working) > > Here's a guide for connecting headphones: > > https://www.microbit.co.uk/blocks/lessons/hack-your-headphones/activity > > A simple bluetooth speaker with headphone plug should work as well. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Experts (#1, Dec 03 2016) > >>> Python Projects, Coaching and Consulting ... http://www.egenix.com/ > >>> Python Database Interfaces ... http://products.egenix.com/ > >>> Plone/Zope Database Interfaces ... http://zope.egenix.com/ > ________________________________________________________________________ > > ::: We implement business ideas - efficiently in both time and costs ::: > > eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 > D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg > Registered at Amtsgericht Duesseldorf: HRB 46611 > http://www.egenix.com/company/contact/ > http://www.malemburg.com/ > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at thinkingbinaries.com Sun Dec 4 08:03:52 2016 From: david at thinkingbinaries.com (David Whale) Date: Sun, 4 Dec 2016 13:03:52 +0000 Subject: [Microbit-Python] 8-Ohm; 1W speaker In-Reply-To: <383042474.2531319.1480851316338.JavaMail.open-xchange@oxbe3.tb.ukmail.iss.as9143.net> References: <95560687.5009722.1480734600401.ref@mail.yahoo.com> <95560687.5009722.1480734600401@mail.yahoo.com> <04985f99-322c-5b6f-a17c-9f439d9603e0@egenix.com> <383042474.2531319.1480851316338.JavaMail.open-xchange@oxbe3.tb.ukmail.iss.as9143.net> Message-ID: The technical spec of the micro:bit edge connector is on the micro:bit tech website here: http://tech.microbit.org/hardware/edgeconnector_ds/ Note the maximum current suggested for the whole edge connector is 90mA to stay within spec. Also, all pins are configured as std-drive, so they will work within full spec at 0.5mA. Full spec means 'the chip will maintain VDD-0.3V on the pin'. As you increase the current drawn from a GPIO pin, the voltage will de-rate. We have some analysis shared with us by a member of the community that shows this de-rating working as expected. The manufacturers of the nRF51 tell us that no damage will be caused to the nRF51 if you draw more current, but that analog and radio performance may be affected, and the VDD-0.3V spec will no longer be maintained. Also, you should consider the effects of the inductive nature of a speaker, which will generate back-EMF spikes that are likely to take the pin outside of it's advertised absolute maximum ratings, which is stated in the data sheet at -0.3V with respect to Ground, also listed on the tech data-sheet, the parameter is as below: VIO Tolerable pin voltages for IO pin (min -0.3V) (max VDD+0.3V) Generally you are better to drive a powered speaker with the micro:bit - e.g. one of those little Bluetooth speakers that has an aux-in 3.5mm socket an integral battery and it's own integral amplifier. David ___________________________________________________________ David Whale, B.Sc (Hons), MIET *Software Engineer and IET Schools Liaison Officer, Essex* On 4 December 2016 at 11:35, Piggott BRUCE wrote: > Hi, > > I have connected an 8 ohm speaker to the microbit outputs from GND to 0 > but it requires a resistor to limit the output current. > > From the microprocessor spec I get a maximum output current of 100mA and > this at 3 volts so by ohms law the minimum load is 30 ohms. > > Subtract the 8 oms of the speaker and the limiting resistor is 22 ohms. > > This works albeit at low speaker power. > > I'm not sure about the maximum output current because another search for > this gave a maximum of 5 mA! > > If this is true then the minimum load would be 600 ohms which would give > very little sound output. > > All I can say is that the 22 ohm series resistor works and doesn't seem to > damage the microbit output pin. > > Hope this helps, Cheers, Bruce > > On 03 December 2016 at 10:50 "M.-A. Lemburg" wrote: > > > On 03.12.2016 04:10, Sven Turnau via Microbit wrote: > > May I connect the 8-Ohm; 1W speaker to Ground & pin 0.Thank You. > > I cannot say whether this would work - it may well break your > microbit due to the low impedance of the speaker. > > I have only tried connecting a headphone so far and this worked > well with the speech API: > > http://microbit-micropython.readthedocs.io/en/latest/tutorials/speech.html > > (you need the most recent MicroPython version to get this working) > > Here's a guide for connecting headphones: > > https://www.microbit.co.uk/blocks/lessons/hack-your-headphones/activity > > A simple bluetooth speaker with headphone plug should work as well. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Experts (#1, Dec 03 2016) > >>> Python Projects, Coaching and Consulting ... http://www.egenix.com/ > >>> Python Database Interfaces ... http://products.egenix.com/ > >>> Plone/Zope Database Interfaces ... http://zope.egenix.com/ > ________________________________________________________________________ > > ::: We implement business ideas - efficiently in both time and costs ::: > > eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 > D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg > Registered at Amtsgericht Duesseldorf: HRB 46611 > http://www.egenix.com/company/contact/ > http://www.malemburg.com/ > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sventurnau at yahoo.com Tue Dec 6 10:28:37 2016 From: sventurnau at yahoo.com (Sven Turnau) Date: Tue, 6 Dec 2016 15:28:37 +0000 (UTC) Subject: [Microbit-Python] Unknown Syntax Error. References: <72823628.561621.1481038117324.ref@mail.yahoo.com> Message-ID: <72823628.561621.1481038117324@mail.yahoo.com> I have no idea how to work this error around. >>> from microbit import *>>> t = running_time()Traceback (most recent call last): File "", line 2SyntaxError: invalid syntax>>> Thank You! -------------- next part -------------- An HTML attachment was scrubbed... URL: From damien.p.george at gmail.com Tue Dec 6 23:44:38 2016 From: damien.p.george at gmail.com (Damien George) Date: Wed, 7 Dec 2016 15:44:38 +1100 Subject: [Microbit-Python] Unknown Syntax Error. In-Reply-To: <72823628.561621.1481038117324@mail.yahoo.com> References: <72823628.561621.1481038117324.ref@mail.yahoo.com> <72823628.561621.1481038117324@mail.yahoo.com> Message-ID: You might have some strange characters on the line, or maybe your "enter" key is sending the wrong code... can you type anything at the REPL prompt, eg 1+1? On 7 December 2016 at 02:28, Sven Turnau via Microbit wrote: > I have no idea how to work this error around. >>>> from microbit import * >>>> t = running_time() > Traceback (most recent call last): > File "", line 2 > SyntaxError: invalid syntax >>>> > Thank You! > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > From danny at orionrobots.co.uk Wed Dec 7 10:24:57 2016 From: danny at orionrobots.co.uk (danny staple) Date: Wed, 07 Dec 2016 15:24:57 +0000 Subject: [Microbit-Python] Unknown Syntax Error. In-Reply-To: References: <72823628.561621.1481038117324.ref@mail.yahoo.com> <72823628.561621.1481038117324@mail.yahoo.com> Message-ID: Try ending the line with "#" which would also indicate odd stuff like line endings. On Wed, 7 Dec 2016 at 04:44 Damien George wrote: > You might have some strange characters on the line, or maybe your > "enter" key is sending the wrong code... can you type anything at the > REPL prompt, eg 1+1? > > On 7 December 2016 at 02:28, Sven Turnau via Microbit > wrote: > > I have no idea how to work this error around. > >>>> from microbit import * > >>>> t = running_time() > > Traceback (most recent call last): > > File "", line 2 > > SyntaxError: invalid syntax > >>>> > > Thank You! > > > > > > _______________________________________________ > > 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 Wed Dec 7 13:06:11 2016 From: david at thinkingbinaries.com (David Whale) Date: Wed, 7 Dec 2016 18:06:11 +0000 Subject: [Microbit-Python] pullups/pulldowns on pins, in MicroPython on micro:bit Message-ID: I remember some discussions about this on github, but I can't find anything in the docs about default pullup/down states (and how to change the pull state of the pins) here: https://microbit-micropython.readthedocs.io/en/latest/pin.html Does anyone know (a) what are the default pull configurations for each of the pins in each of the following pin modes when using MicroPython (I know what the DAL sets them to, but MicroPython doesn't really use the DAL here I think). read_analog read_digital is_touched (b) How do you change the default pull resistor configuration for each of the pins? Thanks David -------------- next part -------------- An HTML attachment was scrubbed... URL: From damien.p.george at gmail.com Thu Dec 8 01:56:31 2016 From: damien.p.george at gmail.com (Damien George) Date: Thu, 8 Dec 2016 17:56:31 +1100 Subject: [Microbit-Python] pullups/pulldowns on pins, in MicroPython on micro:bit In-Reply-To: References: Message-ID: Hi David, Looking at the code the default pull states seem to be: read_analog: configured by mbed analogin_init() function, looks like there is no pull read_digital: PULL_DOWN is_touched: PULL_UP To change the value, use: pin.set_pull(pin.PULL_UP), or PULL_DOWN or NO_PULL. Cheers, Damien. On 8 December 2016 at 05:06, David Whale wrote: > I remember some discussions about this on github, but I can't find anything > in the docs about default pullup/down states (and how to change the pull > state of the pins) here: > > https://microbit-micropython.readthedocs.io/en/latest/pin.html > > Does anyone know > (a) what are the default pull configurations for each of the pins in each of > the following pin modes when using MicroPython (I know what the DAL sets > them to, but MicroPython doesn't really use the DAL here I think). > > read_analog > read_digital > is_touched > > (b) How do you change the default pull resistor configuration for each of > the pins? > > Thanks > > David > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > From david at thinkingbinaries.com Thu Dec 8 05:37:49 2016 From: david at thinkingbinaries.com (David Whale) Date: Thu, 8 Dec 2016 10:37:49 +0000 Subject: [Microbit-Python] pullups/pulldowns on pins, in MicroPython on micro:bit In-Reply-To: References: Message-ID: Ok thanks. I couldn't find this in the latest docs. I'll take another look, perhaps I missed it. On 8 Dec 2016 6:56 am, "Damien George" wrote: > Hi David, > > Looking at the code the default pull states seem to be: > > read_analog: configured by mbed analogin_init() function, looks like > there is no pull > read_digital: PULL_DOWN > is_touched: PULL_UP > > To change the value, use: pin.set_pull(pin.PULL_UP), or PULL_DOWN or > NO_PULL. > > Cheers, > Damien. > > > > On 8 December 2016 at 05:06, David Whale > wrote: > > I remember some discussions about this on github, but I can't find > anything > > in the docs about default pullup/down states (and how to change the pull > > state of the pins) here: > > > > https://microbit-micropython.readthedocs.io/en/latest/pin.html > > > > Does anyone know > > (a) what are the default pull configurations for each of the pins in > each of > > the following pin modes when using MicroPython (I know what the DAL sets > > them to, but MicroPython doesn't really use the DAL here I think). > > > > read_analog > > read_digital > > is_touched > > > > (b) How do you change the default pull resistor configuration for each of > > the pins? > > > > Thanks > > > > David > > > > > > _______________________________________________ > > 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 Thu Dec 8 13:09:06 2016 From: david at thinkingbinaries.com (David Whale) Date: Thu, 8 Dec 2016 18:09:06 +0000 Subject: [Microbit-Python] pullups/pulldowns on pins, in MicroPython on micro:bit In-Reply-To: References: Message-ID: Thanks for your help Damien. I couldn't find this set_pull() in the latest online docs anywhere. So, I logged in github: https://github.com/micropython/micropython/issues/2671 Is the online docs out of date with the latest code? David On 8 December 2016 at 10:37, David Whale wrote: > Ok thanks. I couldn't find this in the latest docs. I'll take another > look, perhaps I missed it. > > On 8 Dec 2016 6:56 am, "Damien George" wrote: > >> Hi David, >> >> Looking at the code the default pull states seem to be: >> >> read_analog: configured by mbed analogin_init() function, looks like >> there is no pull >> read_digital: PULL_DOWN >> is_touched: PULL_UP >> >> To change the value, use: pin.set_pull(pin.PULL_UP), or PULL_DOWN or >> NO_PULL. >> >> Cheers, >> Damien. >> >> >> >> On 8 December 2016 at 05:06, David Whale >> wrote: >> > I remember some discussions about this on github, but I can't find >> anything >> > in the docs about default pullup/down states (and how to change the pull >> > state of the pins) here: >> > >> > https://microbit-micropython.readthedocs.io/en/latest/pin.html >> > >> > Does anyone know >> > (a) what are the default pull configurations for each of the pins in >> each of >> > the following pin modes when using MicroPython (I know what the DAL sets >> > them to, but MicroPython doesn't really use the DAL here I think). >> > >> > read_analog >> > read_digital >> > is_touched >> > >> > (b) How do you change the default pull resistor configuration for each >> of >> > the pins? >> > >> > Thanks >> > >> > David >> > >> > >> > _______________________________________________ >> > 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 arose85618 at aol.com Thu Dec 8 17:00:02 2016 From: arose85618 at aol.com (Austen Rose) Date: Thu, 8 Dec 2016 17:00:02 -0500 Subject: [Microbit-Python] micro:bit - import radio question Message-ID: <158e0734e69-5615-2574@webprd-a65.mail.aol.com> Hi All, I am a recent user of the micro:bit, so apologies for possibly silly question: radio doesn't work with mu? Thanks, Austen -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim at groklearning.com Thu Dec 8 17:11:25 2016 From: jim at groklearning.com (Jim Mussared) Date: Fri, 9 Dec 2016 09:11:25 +1100 Subject: [Microbit-Python] micro:bit - import radio question In-Reply-To: <158e0734e69-5615-2574@webprd-a65.mail.aol.com> References: <158e0734e69-5615-2574@webprd-a65.mail.aol.com> Message-ID: hi Austen, I haven't had any troubles using radio with Mu. Could you please share your code and the version of Mu you're using? Thanks On 9 December 2016 at 09:00, Austen Rose via Microbit wrote: > Hi All, > > I am a recent user of the micro:bit, so apologies for possibly silly > question: > > radio doesn't work with mu? > > Thanks, Austen > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > From david at thinkingbinaries.com Thu Dec 8 17:27:55 2016 From: david at thinkingbinaries.com (David Whale) Date: Thu, 8 Dec 2016 22:27:55 +0000 Subject: [Microbit-Python] micro:bit - import radio question In-Reply-To: References: <158e0734e69-5615-2574@webprd-a65.mail.aol.com> Message-ID: How do we find out the version of mu? On 8 Dec 2016 10:11 pm, "Jim Mussared via Microbit" wrote: hi Austen, I haven't had any troubles using radio with Mu. Could you please share your code and the version of Mu you're using? Thanks On 9 December 2016 at 09:00, Austen Rose via Microbit wrote: > Hi All, > > I am a recent user of the micro:bit, so apologies for possibly silly > question: > > radio doesn't work with mu? > > Thanks, Austen > > > _______________________________________________ > 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 arose85618 at aol.com Thu Dec 8 17:33:35 2016 From: arose85618 at aol.com (Austen Rose) Date: Thu, 8 Dec 2016 17:33:35 -0500 Subject: [Microbit-Python] micro:bit - import radio question In-Reply-To: Message-ID: <158e0920560-5615-274f@webprd-a65.mail.aol.com> Hi Jim, Thanks for helping. I took the example code from: http://microbit-micropython.readthedocs.io/en/latest/tutorials/radio.html and pasted into mu, then downloaded. I got a scrolling error message "..no module named radio..." Thanks, Austen Rose arose85618 at aol.com -----Original Message----- From: Jim Mussared To: For Pythonic MicroBit related discussions CC: Austen Rose Sent: Thu, 8 Dec 2016 22:11 Subject: Re: [Microbit-Python] micro:bit - import radio question hi Austen, I haven't had any troubles using radio with Mu. Could you please share your code and the version of Mu you're using? Thanks On 9 December 2016 at 09:00, Austen Rose via Microbit wrote: > Hi All, > > I am a recent user of the micro:bit, so apologies for possibly silly > question: > > radio doesn't work with mu? > > Thanks, Austen > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -------------- next part -------------- An HTML attachment was scrubbed... URL: From arose85618 at aol.com Thu Dec 8 17:40:17 2016 From: arose85618 at aol.com (Austen Rose) Date: Thu, 8 Dec 2016 17:40:17 -0500 Subject: [Microbit-Python] micro:bit - import radio question In-Reply-To: <158e0920560-5615-274f@webprd-a65.mail.aol.com> Message-ID: <158e0982741-5615-279e@webprd-a65.mail.aol.com> Ahh, I figured it out - stupidly running old version of Mu, so I guess radio was added more recently. It now works. Sorry for the wasted time. Austen Rose arose85618 at aol.com -----Original Message----- From: Austen Rose To: microbit Sent: Thu, 8 Dec 2016 22:33 Subject: Re: [Microbit-Python] micro:bit - import radio question Hi Jim, Thanks for helping. I took the example code from: http://microbit-micropython.readthedocs.io/en/latest/tutorials/radio.html and pasted into mu, then downloaded. I got a scrolling error message "..no module named radio..." Thanks, Austen Rose arose85618 at aol.com -----Original Message----- From: Jim Mussared To: For Pythonic MicroBit related discussions CC: Austen Rose Sent: Thu, 8 Dec 2016 22:11 Subject: Re: [Microbit-Python] micro:bit - import radio question hi Austen, I haven't had any troubles using radio with Mu. Could you please share your code and the version of Mu you're using? Thanks On 9 December 2016 at 09:00, Austen Rose via Microbit wrote: > Hi All, > > I am a recent user of the micro:bit, so apologies for possibly silly > question: > > radio doesn't work with mu? > > Thanks, Austen > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -------------- next part -------------- An HTML attachment was scrubbed... URL: From leeradi07 at gmail.com Fri Dec 9 08:17:09 2016 From: leeradi07 at gmail.com (=?UTF-8?B?7J207Iq566+8?=) Date: Fri, 9 Dec 2016 22:17:09 +0900 Subject: [Microbit-Python] I have question for python with Micro:bit Message-ID: Hello This is Seungmin Lee from South Korea. I am trying to do micro:bit project with micro python . Is it possible to use micropython with mircrobit in order to show kinda chart and graph? I 'd like to the change of acc sensor, temperature can be shown through Graph and chart. Looking forward to your reply. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From barrachri at gmail.com Fri Dec 9 08:38:33 2016 From: barrachri at gmail.com (Christian Barra) Date: Fri, 9 Dec 2016 14:38:33 +0100 Subject: [Microbit-Python] I have question for python with Micro:bit In-Reply-To: References: Message-ID: <0B8E2D95-74B4-43B3-8FCF-122546B10F75@gmail.com> > On 9 Dec 2016, at 14:17, ??? wrote: > > Hello > This is Seungmin Lee from South Korea. > > I am trying to do micro:bit project with micro python . > > Is it possible to use micropython with mircrobit in order to show kinda chart and graph? > > I 'd like to the change of acc sensor, temperature can be shown through Graph and chart. Hi Lee, But where do you want to show the chart and graph ? -- With Gravitational Cheers, Christian Barra EuroPython Society board member -------------- next part -------------- An HTML attachment was scrubbed... URL: From leeradi07 at gmail.com Fri Dec 9 17:38:28 2016 From: leeradi07 at gmail.com (=?UTF-8?B?7J207Iq566+8?=) Date: Sat, 10 Dec 2016 07:38:28 +0900 Subject: [Microbit-Python] Microbit Digest, Vol 19, Issue 8 In-Reply-To: References: Message-ID: Thank you for your reply I d like to do data visualization by using microbit For example . When I use accelometer senser, the value of x.y.z can be shown by chart or graph. If it is possible. how do i prepare for? thank you for reading. 2016. 12. 10. ?? 2:01? ?? ??: Send Microbit mailing list submissions to microbit at python.org To subscribe or unsubscribe via the World Wide Web, visit https://mail.python.org/mailman/listinfo/microbit or, via email, send a message with subject or body 'help' to microbit-request at python.org You can reach the person managing the list at microbit-owner at python.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Microbit digest..." Today's Topics: 1. Re: micro:bit - import radio question (Austen Rose) 2. I have question for python with Micro:bit (???) 3. Re: I have question for python with Micro:bit (Christian Barra) ---------------------------------------------------------------------- Message: 1 Date: Thu, 8 Dec 2016 17:40:17 -0500 From: Austen Rose To: microbit at python.org Subject: Re: [Microbit-Python] micro:bit - import radio question Message-ID: <158e0982741-5615-279e at webprd-a65.mail.aol.com> Content-Type: text/plain; charset="utf-8" Ahh, I figured it out - stupidly running old version of Mu, so I guess radio was added more recently. It now works. Sorry for the wasted time. Austen Rose arose85618 at aol.com -----Original Message----- From: Austen Rose To: microbit Sent: Thu, 8 Dec 2016 22:33 Subject: Re: [Microbit-Python] micro:bit - import radio question Hi Jim, Thanks for helping. I took the example code from: http://microbit-micropython.readthedocs.io/en/latest/tutorials/radio.html and pasted into mu, then downloaded. I got a scrolling error message "..no module named radio..." Thanks, Austen Rose arose85618 at aol.com -----Original Message----- From: Jim Mussared To: For Pythonic MicroBit related discussions CC: Austen Rose Sent: Thu, 8 Dec 2016 22:11 Subject: Re: [Microbit-Python] micro:bit - import radio question hi Austen, I haven't had any troubles using radio with Mu. Could you please share your code and the version of Mu you're using? Thanks On 9 December 2016 at 09:00, Austen Rose via Microbit wrote: > Hi All, > > I am a recent user of the micro:bit, so apologies for possibly silly > question: > > radio doesn't work with mu? > > Thanks, Austen > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 2 Date: Fri, 9 Dec 2016 22:17:09 +0900 From: ??? To: microbit at python.org Subject: [Microbit-Python] I have question for python with Micro:bit Message-ID: Content-Type: text/plain; charset="utf-8" Hello This is Seungmin Lee from South Korea. I am trying to do micro:bit project with micro python . Is it possible to use micropython with mircrobit in order to show kinda chart and graph? I 'd like to the change of acc sensor, temperature can be shown through Graph and chart. Looking forward to your reply. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Message: 3 Date: Fri, 9 Dec 2016 14:38:33 +0100 From: Christian Barra To: For Pythonic MicroBit related discussions Subject: Re: [Microbit-Python] I have question for python with Micro:bit Message-ID: <0B8E2D95-74B4-43B3-8FCF-122546B10F75 at gmail.com> Content-Type: text/plain; charset="utf-8" > On 9 Dec 2016, at 14:17, ??? wrote: > > Hello > This is Seungmin Lee from South Korea. > > I am trying to do micro:bit project with micro python . > > Is it possible to use micropython with mircrobit in order to show kinda chart and graph? > > I 'd like to the change of acc sensor, temperature can be shown through Graph and chart. Hi Lee, But where do you want to show the chart and graph ? -- With Gravitational Cheers, Christian Barra EuroPython Society board member -------------- next part -------------- An HTML attachment was scrubbed... URL: ------------------------------ Subject: Digest Footer _______________________________________________ Microbit mailing list Microbit at python.org https://mail.python.org/mailman/listinfo/microbit ------------------------------ End of Microbit Digest, Vol 19, Issue 8 *************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From nevil.hunt at hotmail.co.uk Sat Dec 10 08:23:08 2016 From: nevil.hunt at hotmail.co.uk (Nevil Hunt) Date: Sat, 10 Dec 2016 13:23:08 +0000 Subject: [Microbit-Python] I have question for python with Micro:bit In-Reply-To: References: Message-ID: Hi, You could take a look at this Adafruit video where they connect a 128x32 OLED display to the micro:bit and display the output of the accelerometer. https://www.youtube.com/watch?v=99oouv7K1w8 Cheers, Nevil ________________________________ From: Microbit on behalf of ??? Sent: 09 December 2016 13:17 To: microbit at python.org Subject: [Microbit-Python] I have question for python with Micro:bit Hello This is Seungmin Lee from South Korea. I am trying to do micro:bit project with micro python . Is it possible to use micropython with mircrobit in order to show kinda chart and graph? I 'd like to the change of acc sensor, temperature can be shown through Graph and chart. Looking forward to your reply. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sventurnau at yahoo.com Sat Dec 10 06:42:55 2016 From: sventurnau at yahoo.com (Sven Turnau) Date: Sat, 10 Dec 2016 11:42:55 +0000 (UTC) Subject: [Microbit-Python] 5/2 References: <1881256261.241779.1481370175372.ref@mail.yahoo.com> Message-ID: <1881256261.241779.1481370175372@mail.yahoo.com> In python IDE I have 5/2 result is 2 not 2.5 as in micropython??Is it an BUG??Thank You. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sparks.m at gmail.com Sat Dec 10 10:54:30 2016 From: sparks.m at gmail.com (Michael) Date: Sat, 10 Dec 2016 15:54:30 +0000 Subject: [Microbit-Python] 5/2 In-Reply-To: <1881256261.241779.1481370175372@mail.yahoo.com> References: <1881256261.241779.1481370175372.ref@mail.yahoo.com> <1881256261.241779.1481370175372@mail.yahoo.com> Message-ID: On 10 December 2016 at 11:42, Sven Turnau via Microbit wrote: > In python IDE > Which python IDE do you mean? It sounds like the python IDE you're using is python 2 based. (eg python 2.7) Micropython is an implementation of python 3. There are slight differences between python 2 and python 3. > I have 5/2 result is 2 not 2.5 as in micropython?? > Is it an BUG?? No, it's an example of one difference between python 2 and python 3. Python 2 uses the rule *"5 is an integer, 2 is an integer, so we'll have the result as an integer"* (Which since 5 is odd, it chops off the decimal part) Python 3 uses the rule *"Python 2 had a confusing result, so let's give a result that people expect from normal maths instead"* :-) Hope that helps, Michael. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nevil.hunt at hotmail.co.uk Mon Dec 12 14:32:31 2016 From: nevil.hunt at hotmail.co.uk (Nevil Hunt) Date: Mon, 12 Dec 2016 19:32:31 +0000 Subject: [Microbit-Python] Driving Neopixels with Pxx other than P0,P1,P2? Message-ID: Hi, I've just got the micro:bit driving the Adafruit Neopixel Feather board using the example Python code in the 'read-the-docs' and it works well! (but I might need to buy a new pair of sunglasses!) The 'read-the-docs' says it can use P0, P1 or P2 which I've checked all work. I then wondered if it would work with other Pxx such as P8, P12 or P16 but it doesn't. Since driving Neopixels is entirely digital is there any fundamental reason why the use of other Pxx couldn't one day be enabled? Cheers, Nevil -------------- next part -------------- An HTML attachment was scrubbed... URL: From damien.p.george at gmail.com Mon Dec 12 21:22:04 2016 From: damien.p.george at gmail.com (Damien George) Date: Tue, 13 Dec 2016 13:22:04 +1100 Subject: [Microbit-Python] Driving Neopixels with Pxx other than P0, P1, P2? In-Reply-To: References: Message-ID: Hi Nevil, Neopixels should work on all pins.... make sure the pin is not being used for something else (eg display), then try doing write_digital on that pin before using it as a neopixel output. Cheers, Damien. On 13 December 2016 at 06:32, Nevil Hunt wrote: > Hi, > > > I've just got the micro:bit driving the Adafruit Neopixel Feather board > using the example Python code in the 'read-the-docs' and it works well! (but > I might need to buy a new pair of sunglasses!) > > > The 'read-the-docs' says it can use P0, P1 or P2 which I've checked all > work. I then wondered if it would work with other Pxx such as P8, P12 or P16 > but it doesn't. > > > Since driving Neopixels is entirely digital is there any fundamental reason > why the use of other Pxx couldn't one day be enabled? > > > > Cheers, > > > Nevil > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > From nevil.hunt at hotmail.co.uk Tue Dec 13 04:40:16 2016 From: nevil.hunt at hotmail.co.uk (Nevil Hunt) Date: Tue, 13 Dec 2016 09:40:16 +0000 Subject: [Microbit-Python] Driving Neopixels with Pxx other than P0, P1, P2? In-Reply-To: References: , Message-ID: Hi Damien, Thanks for the suggestion. I gave it a go but unfortunately it didn't bring it to life. I tried P8,12,13,14,15,16 and none of them drive the NeoPixels. If enabling NeoPixels on these additional Pxx pins would just be a simple s/w change it would be good to have as the P0,P1,P2 are precious resources. Either way this is the first time I've had a play with NeoPixels and they are good fun! Cheers, Nevil ________________________________ From: Microbit on behalf of Damien George Sent: 13 December 2016 02:22 To: For Pythonic MicroBit related discussions Subject: Re: [Microbit-Python] Driving Neopixels with Pxx other than P0, P1, P2? Hi Nevil, Neopixels should work on all pins.... make sure the pin is not being used for something else (eg display), then try doing write_digital on that pin before using it as a neopixel output. Cheers, Damien. On 13 December 2016 at 06:32, Nevil Hunt wrote: > Hi, > > > I've just got the micro:bit driving the Adafruit Neopixel Feather board > using the example Python code in the 'read-the-docs' and it works well! (but > I might need to buy a new pair of sunglasses!) > > > The 'read-the-docs' says it can use P0, P1 or P2 which I've checked all > work. I then wondered if it would work with other Pxx such as P8, P12 or P16 > but it doesn't. > > > Since driving Neopixels is entirely digital is there any fundamental reason > why the use of other Pxx couldn't one day be enabled? > > > > Cheers, > > > Nevil > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit Microbit Info Page - Python mail.python.org The MicroBit is a small programmable device for children created by the BBC (in partnership with various other organisations, such as the PSF). > _______________________________________________ Microbit mailing list Microbit at python.org https://mail.python.org/mailman/listinfo/microbit Microbit Info Page - Python mail.python.org The MicroBit is a small programmable device for children created by the BBC (in partnership with various other organisations, such as the PSF). -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlosperate at gmail.com Tue Dec 13 06:32:11 2016 From: carlosperate at gmail.com (Carlos Pereira Atencio) Date: Tue, 13 Dec 2016 11:32:11 +0000 Subject: [Microbit-Python] Driving Neopixels with Pxx other than P0, P1, P2? In-Reply-To: References: Message-ID: A bit of shot in the dark, since I haven't really manually driven neopixels before, but if they run on the 1-wire protocol, don't the need a pull up? The large GPIO connectors would have a weak pull up on then, so that could be the main difference. On 13 December 2016 at 09:40, Nevil Hunt wrote: > Hi Damien, > > > Thanks for the suggestion. I gave it a go but unfortunately it didn't > bring it to life. > > I tried P8,12,13,14,15,16 and none of them drive the NeoPixels. > > If enabling NeoPixels on these additional Pxx pins would just be a simple > s/w change it would be good to have as the P0,P1,P2 are precious resources. > > Either way this is the first time I've had a play with NeoPixels and they > are good fun! > > > Cheers, > > > Nevil > > > ------------------------------ > *From:* Microbit > on behalf of Damien George > *Sent:* 13 December 2016 02:22 > *To:* For Pythonic MicroBit related discussions > *Subject:* Re: [Microbit-Python] Driving Neopixels with Pxx other than > P0, P1, P2? > > Hi Nevil, > > Neopixels should work on all pins.... make sure the pin is not being > used for something else (eg display), then try doing write_digital on > that pin before using it as a neopixel output. > > Cheers, > Damien. > > On 13 December 2016 at 06:32, Nevil Hunt wrote: > > Hi, > > > > > > I've just got the micro:bit driving the Adafruit Neopixel Feather board > > using the example Python code in the 'read-the-docs' and it works well! > (but > > I might need to buy a new pair of sunglasses!) > > > > > > The 'read-the-docs' says it can use P0, P1 or P2 which I've checked all > > work. I then wondered if it would work with other Pxx such as P8, P12 or > P16 > > but it doesn't. > > > > > > Since driving Neopixels is entirely digital is there any fundamental > reason > > why the use of other Pxx couldn't one day be enabled? > > > > > > > > Cheers, > > > > > > Nevil > > > > > > _______________________________________________ > > Microbit mailing list > > Microbit at python.org > > https://mail.python.org/mailman/listinfo/microbit > > Microbit Info Page - Python > > mail.python.org > The MicroBit is a small programmable device for children created by the > BBC (in partnership with various other organisations, such as the PSF). > > > > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > > Microbit Info Page - Python > > mail.python.org > The MicroBit is a small programmable device for children created by the > BBC (in partnership with various other organisations, such as the PSF). > > > > > _______________________________________________ > 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 Tue Dec 13 06:43:10 2016 From: david at thinkingbinaries.com (David Whale) Date: Tue, 13 Dec 2016 11:43:10 +0000 Subject: [Microbit-Python] Driving Neopixels with Pxx other than P0, P1, P2? In-Reply-To: References: Message-ID: P0 P1 and P2 have a 10-meg pull-up fitted on the board. The two button pins P5 and P11 have 10k pull-ups fitted on the board (but are defaulted in the software to be inputs for use by the buttons). If in doubt, always refer to the official edge connector data-sheet here: http://tech.microbit.org/hardware/edgeconnector_ds/ On 13 December 2016 at 11:32, Carlos Pereira Atencio wrote: > A bit of shot in the dark, since I haven't really manually driven > neopixels before, but if they run on the 1-wire protocol, don't the need a > pull up? The large GPIO connectors would have a weak pull up on then, so > that could be the main difference. > > > On 13 December 2016 at 09:40, Nevil Hunt wrote: > >> Hi Damien, >> >> >> Thanks for the suggestion. I gave it a go but unfortunately it didn't >> bring it to life. >> >> I tried P8,12,13,14,15,16 and none of them drive the NeoPixels. >> >> If enabling NeoPixels on these additional Pxx pins would just be a simple >> s/w change it would be good to have as the P0,P1,P2 are precious resources. >> >> Either way this is the first time I've had a play with NeoPixels and they >> are good fun! >> >> >> Cheers, >> >> >> Nevil >> >> >> ------------------------------ >> *From:* Microbit >> on behalf of Damien George >> *Sent:* 13 December 2016 02:22 >> *To:* For Pythonic MicroBit related discussions >> *Subject:* Re: [Microbit-Python] Driving Neopixels with Pxx other than >> P0, P1, P2? >> >> Hi Nevil, >> >> Neopixels should work on all pins.... make sure the pin is not being >> used for something else (eg display), then try doing write_digital on >> that pin before using it as a neopixel output. >> >> Cheers, >> Damien. >> >> On 13 December 2016 at 06:32, Nevil Hunt >> wrote: >> > Hi, >> > >> > >> > I've just got the micro:bit driving the Adafruit Neopixel Feather board >> > using the example Python code in the 'read-the-docs' and it works well! >> (but >> > I might need to buy a new pair of sunglasses!) >> > >> > >> > The 'read-the-docs' says it can use P0, P1 or P2 which I've checked all >> > work. I then wondered if it would work with other Pxx such as P8, P12 >> or P16 >> > but it doesn't. >> > >> > >> > Since driving Neopixels is entirely digital is there any fundamental >> reason >> > why the use of other Pxx couldn't one day be enabled? >> > >> > >> > >> > Cheers, >> > >> > >> > Nevil >> > >> > >> > _______________________________________________ >> > Microbit mailing list >> > Microbit at python.org >> > https://mail.python.org/mailman/listinfo/microbit >> >> Microbit Info Page - Python >> >> mail.python.org >> The MicroBit is a small programmable device for children created by the >> BBC (in partnership with various other organisations, such as the PSF). >> >> >> >> > >> _______________________________________________ >> Microbit mailing list >> Microbit at python.org >> https://mail.python.org/mailman/listinfo/microbit >> >> Microbit Info Page - Python >> >> mail.python.org >> The MicroBit is a small programmable device for children created by the >> BBC (in partnership with various other organisations, such as the PSF). >> >> >> >> >> _______________________________________________ >> 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 nevil.hunt at hotmail.co.uk Tue Dec 13 06:55:43 2016 From: nevil.hunt at hotmail.co.uk (Nevil Hunt) Date: Tue, 13 Dec 2016 11:55:43 +0000 Subject: [Microbit-Python] Driving Neopixels with Pxx other than P0, P1, P2? In-Reply-To: References: , Message-ID: Hi Carlos, I've had a look at the signal on a scope and there is no sign of movement on P8, etc so I don't think it is just a pull up issue. In fact I think the NeoPixel protocol drives the signals both high and low, unlike I2C which relies on the pullups to pull the signal high. Interestingly looking through your microbit broadcast I notice 4tronix are using NeoPixels on P13 and have a bit of Python and PXT showing how to do it. I wonder if they have actually tried it with Python, or just with PXT. Interestingly I then tried it with PXT and with the new version of PXT I can't get it to enable the NeoPixel Library so I've dropped Tom & Peli an email. Cheers, Nevil ________________________________ From: Microbit on behalf of Carlos Pereira Atencio Sent: 13 December 2016 11:32 To: For Pythonic MicroBit related discussions Subject: Re: [Microbit-Python] Driving Neopixels with Pxx other than P0, P1, P2? A bit of shot in the dark, since I haven't really manually driven neopixels before, but if they run on the 1-wire protocol, don't the need a pull up? The large GPIO connectors would have a weak pull up on then, so that could be the main difference. On 13 December 2016 at 09:40, Nevil Hunt > wrote: Hi Damien, Thanks for the suggestion. I gave it a go but unfortunately it didn't bring it to life. I tried P8,12,13,14,15,16 and none of them drive the NeoPixels. If enabling NeoPixels on these additional Pxx pins would just be a simple s/w change it would be good to have as the P0,P1,P2 are precious resources. Either way this is the first time I've had a play with NeoPixels and they are good fun! Cheers, Nevil ________________________________ From: Microbit > on behalf of Damien George > Sent: 13 December 2016 02:22 To: For Pythonic MicroBit related discussions Subject: Re: [Microbit-Python] Driving Neopixels with Pxx other than P0, P1, P2? Hi Nevil, Neopixels should work on all pins.... make sure the pin is not being used for something else (eg display), then try doing write_digital on that pin before using it as a neopixel output. Cheers, Damien. On 13 December 2016 at 06:32, Nevil Hunt > wrote: > Hi, > > > I've just got the micro:bit driving the Adafruit Neopixel Feather board > using the example Python code in the 'read-the-docs' and it works well! (but > I might need to buy a new pair of sunglasses!) > > > The 'read-the-docs' says it can use P0, P1 or P2 which I've checked all > work. I then wondered if it would work with other Pxx such as P8, P12 or P16 > but it doesn't. > > > Since driving Neopixels is entirely digital is there any fundamental reason > why the use of other Pxx couldn't one day be enabled? > > > > Cheers, > > > Nevil > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit Microbit Info Page - Python mail.python.org The MicroBit is a small programmable device for children created by the BBC (in partnership with various other organisations, such as the PSF). > _______________________________________________ Microbit mailing list Microbit at python.org https://mail.python.org/mailman/listinfo/microbit Microbit Info Page - Python mail.python.org The MicroBit is a small programmable device for children created by the BBC (in partnership with various other organisations, such as the PSF). _______________________________________________ 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 Tue Dec 13 08:18:46 2016 From: nevil.hunt at hotmail.co.uk (Nevil Hunt) Date: Tue, 13 Dec 2016 13:18:46 +0000 Subject: [Microbit-Python] Driving Neopixels with Pxx other than P0, P1, P2? In-Reply-To: References: , , Message-ID: Sorry everyone! 'Finger trouble' on my behalf! I can confirm Neopixels do work with P8,P12,P13,P14,P15,P16 when driven from Micro Python. The problem was laziness on my behalf! Most of my test rigs have all pins connected, large and small. But because I thought NeoPixels might only work with P0,P1,P2 I didn't connect up the small pads on this test rig. (Connections are hidden on my test rigs). Once connected everything magically works! Cheers, Nevil ________________________________ From: Nevil Hunt Sent: 13 December 2016 11:55 To: For Pythonic MicroBit related discussions Subject: Re: [Microbit-Python] Driving Neopixels with Pxx other than P0, P1, P2? Hi Carlos, I've had a look at the signal on a scope and there is no sign of movement on P8, etc so I don't think it is just a pull up issue. In fact I think the NeoPixel protocol drives the signals both high and low, unlike I2C which relies on the pullups to pull the signal high. Interestingly looking through your microbit broadcast I notice 4tronix are using NeoPixels on P13 and have a bit of Python and PXT showing how to do it. I wonder if they have actually tried it with Python, or just with PXT. Interestingly I then tried it with PXT and with the new version of PXT I can't get it to enable the NeoPixel Library so I've dropped Tom & Peli an email. Cheers, Nevil ________________________________ From: Microbit on behalf of Carlos Pereira Atencio Sent: 13 December 2016 11:32 To: For Pythonic MicroBit related discussions Subject: Re: [Microbit-Python] Driving Neopixels with Pxx other than P0, P1, P2? A bit of shot in the dark, since I haven't really manually driven neopixels before, but if they run on the 1-wire protocol, don't the need a pull up? The large GPIO connectors would have a weak pull up on then, so that could be the main difference. On 13 December 2016 at 09:40, Nevil Hunt > wrote: Hi Damien, Thanks for the suggestion. I gave it a go but unfortunately it didn't bring it to life. I tried P8,12,13,14,15,16 and none of them drive the NeoPixels. If enabling NeoPixels on these additional Pxx pins would just be a simple s/w change it would be good to have as the P0,P1,P2 are precious resources. Either way this is the first time I've had a play with NeoPixels and they are good fun! Cheers, Nevil ________________________________ From: Microbit > on behalf of Damien George > Sent: 13 December 2016 02:22 To: For Pythonic MicroBit related discussions Subject: Re: [Microbit-Python] Driving Neopixels with Pxx other than P0, P1, P2? Hi Nevil, Neopixels should work on all pins.... make sure the pin is not being used for something else (eg display), then try doing write_digital on that pin before using it as a neopixel output. Cheers, Damien. On 13 December 2016 at 06:32, Nevil Hunt > wrote: > Hi, > > > I've just got the micro:bit driving the Adafruit Neopixel Feather board > using the example Python code in the 'read-the-docs' and it works well! (but > I might need to buy a new pair of sunglasses!) > > > The 'read-the-docs' says it can use P0, P1 or P2 which I've checked all > work. I then wondered if it would work with other Pxx such as P8, P12 or P16 > but it doesn't. > > > Since driving Neopixels is entirely digital is there any fundamental reason > why the use of other Pxx couldn't one day be enabled? > > > > Cheers, > > > Nevil > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit Microbit Info Page - Python mail.python.org The MicroBit is a small programmable device for children created by the BBC (in partnership with various other organisations, such as the PSF). > _______________________________________________ Microbit mailing list Microbit at python.org https://mail.python.org/mailman/listinfo/microbit Microbit Info Page - Python mail.python.org The MicroBit is a small programmable device for children created by the BBC (in partnership with various other organisations, such as the PSF). _______________________________________________ Microbit mailing list Microbit at python.org https://mail.python.org/mailman/listinfo/microbit -------------- next part -------------- An HTML attachment was scrubbed... URL: From sventurnau at yahoo.com Thu Dec 15 13:08:04 2016 From: sventurnau at yahoo.com (Sven Turnau) Date: Thu, 15 Dec 2016 18:08:04 +0000 (UTC) Subject: [Microbit-Python] Sky.py Plz make it bettter References: <1173715951.3433847.1481825284646.ref@mail.yahoo.com> Message-ID: <1173715951.3433847.1481825284646@mail.yahoo.com> Hello.I'm not good in teaching, but I have done my best.There is a Sky (? 5x5 ) Starplaces and H (must be tuned H << 25) stars randomly put on the Sky.There is a Rest of Lifetime ( N[4] ) for each Star and current Brightness? N[2]? (0..9) for each Star.The method correct() corrrect the current valuesfor each Star.?? I will be happy if this program will be useful for teaching.? The program is Debugged on the Micro:Bit board.If someone can do it better I will be happy to receivea copy of the program.Bye. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Sky.py Type: text/x-python Size: 1264 bytes Desc: not available URL: From jim at groklearning.com Thu Dec 15 16:52:05 2016 From: jim at groklearning.com (Jim Mussared) Date: Fri, 16 Dec 2016 08:52:05 +1100 Subject: [Microbit-Python] Sky.py Plz make it bettter In-Reply-To: <1173715951.3433847.1481825284646@mail.yahoo.com> References: <1173715951.3433847.1481825284646.ref@mail.yahoo.com> <1173715951.3433847.1481825284646@mail.yahoo.com> Message-ID: hi Sven, Two main things would help you for this program: 1 - Naming the variables based on what they actually are - instead of 'H', call it 'stars'. 2 - Lists get a bit difficult when you have to remember what each of the individual elements are for. This is exactly what classes are designed for. Also this helps you with #1 - because you can name each of the things. I've attached an example. There's also something quite subtle in this program which is the way the display.clear() changes the behaviour from just having the stars fade in or out, but instead every 15 frames it resets back down to a single star showing. (Which is quite a neat effect but not what you described -- the joys of graphics programming :D ) Jim On 16 December 2016 at 05:08, Sven Turnau via Microbit wrote: > Hello. > I'm not good in teaching, but I have done my best. > There is a Sky ( 5x5 ) Starplaces and > H (must be tuned H << 25) stars randomly put on the Sky. > There is a Rest of Lifetime ( N[4] ) for each Star > and current Brightness N[2] (0..9) for each Star. > The method correct() corrrect the current values > for each Star. > I will be happy if this program will be useful > for teaching. > The program is Debugged on the Micro:Bit board. > If someone can do it better I will be happy to receive > a copy of the program. > Bye. > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -------------- next part -------------- A non-text attachment was scrubbed... Name: sky.py Type: text/x-python Size: 574 bytes Desc: not available URL: From david.f.booth at googlemail.com Sun Dec 18 11:36:52 2016 From: david.f.booth at googlemail.com (David Booth) Date: Sun, 18 Dec 2016 16:36:52 +0000 Subject: [Microbit-Python] Sending an integer by radio Message-ID: Hi I have two micro:bits. How do I send the x acceleration (i.e.+/- 0 to 1023) from one to a variable x_accel on the other by radio? Thank you David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.f.booth at googlemail.com Sun Dec 18 11:33:43 2016 From: david.f.booth at googlemail.com (David Booth) Date: Sun, 18 Dec 2016 16:33:43 -0000 Subject: [Microbit-Python] Transmitting Integers by radio Message-ID: Hi I have two micro:bits. How do I transmit the x axis acceleration i.e. + or ?, 0 to 1023 from one micro:bit to a variable x_accel in the other? Thank you David Booth -------------- next part -------------- An HTML attachment was scrubbed... URL: From ntoll at ntoll.org Mon Dec 19 03:55:25 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Mon, 19 Dec 2016 08:55:25 +0000 Subject: [Microbit-Python] Transmitting Integers by radio In-Reply-To: References: Message-ID: <142b8ebc-213e-7ca1-a3a7-992a36c63138@ntoll.org> Hi David, I notice you're not a subscriber to the list. In order to get responses to your question please subscribe via the link at the bottom of this email. In any case, to answer your question, you have two choices: * Send and decode bytes (https://microbit-micropython.readthedocs.io/en/latest/radio.html#radio.send_bytes) * Send and decode a string. We made the simple string based send/receive available since it's very simple and child friendly. It's actually a wrapper around the bytes related methods. In either case you're going to have to convert the int into something else (and back again). In Python that's simply just str(10) or int("10") for example. Hope this helps, N. On 18/12/16 16:33, David Booth via Microbit wrote: > Hi > I have two micro:bits. How do I transmit the x axis acceleration i.e. > + or ?, 0 to 1023 from one micro:bit to a variable x_accel in the other? > Thank you > David Booth > > > _______________________________________________ > 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: 455 bytes Desc: OpenPGP digital signature URL: From mark at hotpy.org Mon Dec 19 06:25:11 2016 From: mark at hotpy.org (Mark Shannon) Date: Mon, 19 Dec 2016 11:25:11 +0000 Subject: [Microbit-Python] Sending an integer by radio In-Reply-To: References: Message-ID: <7e0cfd64-1703-4471-e664-e24f1c758176@hotpy.org> Hi David, Just convert the integer value to a string and then send that. send: radio.send(str(x_accel)) receive: x_accel = int(radio.recv()) Mark. On 18/12/16 16:36, David Booth via Microbit wrote: > Hi > I have two micro:bits. How do I send the x acceleration (i.e.+/- 0 to > 1023) from one to a variable x_accel on the other by radio? > > Thank you > David > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > From david.f.booth at googlemail.com Mon Dec 19 09:09:53 2016 From: david.f.booth at googlemail.com (David Booth) Date: Mon, 19 Dec 2016 14:09:53 +0000 Subject: [Microbit-Python] Sending an integer by radio In-Reply-To: <7e0cfd64-1703-4471-e664-e24f1c758176@hotpy.org> References: <7e0cfd64-1703-4471-e664-e24f1c758176@hotpy.org> Message-ID: Hi Mark I used the following to transmit accel = accelerometer.get_x() accel_str = str(accel) radio.send(accel_str) and the following to receive which gave a Type error None accel = int(radio.receive()) All the best David On 19 December 2016 at 11:25, Mark Shannon wrote: > Hi David, > > Just convert the integer value to a string and then send that. > send: > radio.send(str(x_accel)) > receive: > x_accel = int(radio.recv()) > > Mark. > > On 18/12/16 16:36, David Booth via Microbit wrote: > >> Hi >> I have two micro:bits. How do I send the x acceleration (i.e.+/- 0 to >> 1023) from one to a variable x_accel on the other by radio? >> >> Thank you >> David >> >> >> _______________________________________________ >> 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.f.booth at googlemail.com Mon Dec 19 09:14:55 2016 From: david.f.booth at googlemail.com (David Booth) Date: Mon, 19 Dec 2016 14:14:55 +0000 Subject: [Microbit-Python] Sending an integer by radio In-Reply-To: <7e0cfd64-1703-4471-e664-e24f1c758176@hotpy.org> References: <7e0cfd64-1703-4471-e664-e24f1c758176@hotpy.org> Message-ID: Hi Mark Nicholas Tollervey has just told me why my script does not work and provided me with the following What's the solution..? It's easy, you simply need to keep polling until a message is received: import radio radio.on() msg = None while not msg: msg = radio.receive() my_number = int(msg) Have a happy Christmas David On 19 December 2016 at 11:25, Mark Shannon wrote: > Hi David, > > Just convert the integer value to a string and then send that. > send: > radio.send(str(x_accel)) > receive: > x_accel = int(radio.recv()) > > Mark. > > On 18/12/16 16:36, David Booth via Microbit wrote: > >> Hi >> I have two micro:bits. How do I send the x acceleration (i.e.+/- 0 to >> 1023) from one to a variable x_accel on the other by radio? >> >> Thank you >> David >> >> >> _______________________________________________ >> 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 danny at orionrobots.co.uk Mon Dec 19 08:51:00 2016 From: danny at orionrobots.co.uk (danny staple) Date: Mon, 19 Dec 2016 13:51:00 +0000 Subject: [Microbit-Python] Sending an integer by radio In-Reply-To: <7e0cfd64-1703-4471-e664-e24f1c758176@hotpy.org> References: <7e0cfd64-1703-4471-e664-e24f1c758176@hotpy.org> Message-ID: I am slightly ignorant on all this (not tried playing with 2 microbits) but is there a packet size limit - or does it automatically send stuff? Is the json module available? On Mon, 19 Dec 2016 at 11:25 Mark Shannon wrote: > Hi David, > > Just convert the integer value to a string and then send that. > send: > radio.send(str(x_accel)) > receive: > x_accel = int(radio.recv()) > > Mark. > > On 18/12/16 16:36, David Booth via Microbit wrote: > > Hi > > I have two micro:bits. How do I send the x acceleration (i.e.+/- 0 to > > 1023) from one to a variable x_accel on the other by radio? > > > > Thank you > > David > > > > > > _______________________________________________ > > 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 > -- JustGiving - Sponsor me now! -------------- next part -------------- An HTML attachment was scrubbed... URL: From titimoby at gmail.com Mon Dec 19 09:23:18 2016 From: titimoby at gmail.com (Thierry Chantier) Date: Mon, 19 Dec 2016 14:23:18 +0000 Subject: [Microbit-Python] Sending an integer by radio In-Reply-To: References: <7e0cfd64-1703-4471-e664-e24f1c758176@hotpy.org> Message-ID: If you want, I published some code I used with kids to play with radio messages. https://github.com/titimoby/microbit4all/tree/master/src/radio Le lun. 19 d?c. 2016 ? 15:21, danny staple a ?crit : > I am slightly ignorant on all this (not tried playing with 2 microbits) > but is there a packet size limit - or does it automatically send stuff? Is > the json module available? > > On Mon, 19 Dec 2016 at 11:25 Mark Shannon wrote: > > Hi David, > > Just convert the integer value to a string and then send that. > send: > radio.send(str(x_accel)) > receive: > x_accel = int(radio.recv()) > > Mark. > > On 18/12/16 16:36, David Booth via Microbit wrote: > > Hi > > I have two micro:bits. How do I send the x acceleration (i.e.+/- 0 to > > 1023) from one to a variable x_accel on the other by radio? > > > > Thank you > > David > > > > > > _______________________________________________ > > 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 > > -- > width='120' height='90' alt='JustGiving - Sponsor me now!' /> > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at stevesimmons.com Mon Dec 19 09:45:59 2016 From: mail at stevesimmons.com (Stephen Simmons) Date: Mon, 19 Dec 2016 14:45:59 +0000 Subject: [Microbit-Python] Sending an integer by radio In-Reply-To: References: Message-ID: <1BDD5C7D-997F-44A2-AA28-C7FD82C0B483@stevesimmons.com> David, If you are interested in a longer example of sending microbit motion data by radio, I did a talk on it at Pycon UK in September. The presentation and code are here in my github repo: https://github.com/stevesimmons/pyconuk-motion-sensor-data-fusion Stephen Message: 6 Date: Mon, 19 Dec 2016 14:14:55 +0000 From: David Booth To: For Pythonic MicroBit related discussions Subject: Re: [Microbit-Python] Sending an integer by radio Message-ID: Content-Type: text/plain; charset="utf-8" Hi Mark Nicholas Tollervey has just told me why my script does not work and provided me with the following What's the solution..? It's easy, you simply need to keep polling until a message is received: import radio radio.on() msg = None while not msg: msg = radio.receive() my_number = int(msg) Have a happy Christmas David -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.f.booth at googlemail.com Mon Dec 19 15:35:06 2016 From: david.f.booth at googlemail.com (David Booth) Date: Mon, 19 Dec 2016 20:35:06 +0000 Subject: [Microbit-Python] Sending an integer by radio In-Reply-To: References: <7e0cfd64-1703-4471-e664-e24f1c758176@hotpy.org> Message-ID: Hi Danny Thank you for your suggestion. I appreciate you responding. In fact I had tried that but got a Type error of None. It has been pointed out to me that I have to filter out the None return with script like the following radio.on() accel_str = None while not accel_str: accel_str = radio.receive() accel = int(accel_str) And now I have a working system. Have a happy Christmas David On 19 December 2016 at 13:51, danny staple wrote: > I am slightly ignorant on all this (not tried playing with 2 microbits) > but is there a packet size limit - or does it automatically send stuff? Is > the json module available? > > On Mon, 19 Dec 2016 at 11:25 Mark Shannon wrote: > >> Hi David, >> >> Just convert the integer value to a string and then send that. >> send: >> radio.send(str(x_accel)) >> receive: >> x_accel = int(radio.recv()) >> >> Mark. >> >> On 18/12/16 16:36, David Booth via Microbit wrote: >> > Hi >> > I have two micro:bits. How do I send the x acceleration (i.e.+/- 0 to >> > 1023) from one to a variable x_accel on the other by radio? >> > >> > Thank you >> > David >> > >> > >> > _______________________________________________ >> > 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 >> > -- > height='90' alt='JustGiving - Sponsor me now!' /> > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.f.booth at googlemail.com Mon Dec 19 15:44:27 2016 From: david.f.booth at googlemail.com (David Booth) Date: Mon, 19 Dec 2016 20:44:27 +0000 Subject: [Microbit-Python] Sending an integer by radio In-Reply-To: References: <7e0cfd64-1703-4471-e664-e24f1c758176@hotpy.org> Message-ID: Hi Thierry Thank you very much for you reply. In my case I need to send a range of integers from -1023 to +1023 and it has been pointed out to me that I have to do more than convert them to a string and on reception convert them to an integer because if I do just that I get a Type error of None. This is the receiving script snippet which has been suggested and works should you ever have the need. radio.on() accel_str = None while not accel_str: accel_str = radio.receive() accel = int(accel_str) Thanks again Have a happy Christmas. David On 19 December 2016 at 14:23, Thierry Chantier wrote: > If you want, I published some code I used with kids to play with radio > messages. > https://github.com/titimoby/microbit4all/tree/master/src/radio > > > Le lun. 19 d?c. 2016 ? 15:21, danny staple a > ?crit : > >> I am slightly ignorant on all this (not tried playing with 2 microbits) >> but is there a packet size limit - or does it automatically send stuff? Is >> the json module available? >> >> On Mon, 19 Dec 2016 at 11:25 Mark Shannon wrote: >> >> Hi David, >> >> Just convert the integer value to a string and then send that. >> send: >> radio.send(str(x_accel)) >> receive: >> x_accel = int(radio.recv()) >> >> Mark. >> >> On 18/12/16 16:36, David Booth via Microbit wrote: >> > Hi >> > I have two micro:bits. How do I send the x acceleration (i.e.+/- 0 to >> > 1023) from one to a variable x_accel on the other by radio? >> > >> > Thank you >> > David >> > >> > >> > _______________________________________________ >> > 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 >> >> -- >> > height='90' alt='JustGiving - Sponsor me now!' /> >> _______________________________________________ >> 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 Tue Dec 20 16:35:59 2016 From: david at thinkingbinaries.com (David Whale) Date: Tue, 20 Dec 2016 21:35:59 +0000 Subject: [Microbit-Python] List of error codes and their meanings Message-ID: Is there anything in the docs that lists all the errors (exceptions) that can occur in MicroPython and what they mean? The closest I found was this: https://github.com/bbcmicrobit/micropython/blob/a20fbe82c919cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h Thanks David microbit.org-ticket: 460 -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at thinkingbinaries.com Tue Dec 20 16:37:25 2016 From: david at thinkingbinaries.com (David Whale) Date: Tue, 20 Dec 2016 21:37:25 +0000 Subject: [Microbit-Python] How to find out how much free space there is on filing system Message-ID: Is there a way to find out how much free space there is on the filing system? I can't see anything in the API docs, the best I can see is to try to write to a file and see if it fails. However, it would be helpful to know in advance of writing how much space is left. Thanks David microbit.org-ticket: 460 -------------- next part -------------- An HTML attachment was scrubbed... URL: From damien.p.george at gmail.com Tue Dec 20 18:26:28 2016 From: damien.p.george at gmail.com (Damien George) Date: Wed, 21 Dec 2016 10:26:28 +1100 Subject: [Microbit-Python] How to find out how much free space there is on filing system In-Reply-To: References: Message-ID: No, at the moment there is no function to tell how much space is left on the internal filesystem. In CPython, and upstream MicroPython, one uses the os.statvfs() function which returns a bunch of information, like number of free blocks, free inodes, block size. etc. Then you compute the free space by using block_size * num_free_blocks. Arguably, one would want a simpler function for microbit users. On 21 December 2016 at 08:37, David Whale wrote: > Is there a way to find out how much free space there is on the filing > system? I can't see anything in the API docs, the best I can see is to try > to write to a file and see if it fails. However, it would be helpful to know > in advance of writing how much space is left. > > Thanks > > David > > microbit.org-ticket: 460 > > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > From damien.p.george at gmail.com Tue Dec 20 18:31:52 2016 From: damien.p.george at gmail.com (Damien George) Date: Wed, 21 Dec 2016 10:31:52 +1100 Subject: [Microbit-Python] List of error codes and their meanings In-Reply-To: References: Message-ID: There are many exceptions and they can occur for many reasons. Almost all are based on CPython and the exceptions form a hierarchy. Eg, indexing a list with an out-of-bounds index will raise IndexError, which derives from LookupError, which derives from Exception, which derives from BaseException. For a list of implemented exceptions in MicroPython see https://github.com/bbcmicrobit/micropython/blob/master/source/py/objexcept.c#L192-L280 On 21 December 2016 at 08:35, David Whale wrote: > Is there anything in the docs that lists all the errors (exceptions) that > can occur in MicroPython and what they mean? > > The closest I found was this: > > https://github.com/bbcmicrobit/micropython/blob/a20fbe82c919cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h > > > Thanks > > David > > microbit.org-ticket: 460 > > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > From david.f.booth at googlemail.com Wed Dec 21 05:56:56 2016 From: david.f.booth at googlemail.com (David Booth) Date: Wed, 21 Dec 2016 10:56:56 +0000 Subject: [Microbit-Python] How to find out how much free space there is on filing system In-Reply-To: References: Message-ID: Hi Damien Thank you for your reply. Congratulations on providing micro Python for the micro:bit. Currently it is the only way I can drive any pin as an analogue output which is needed if the Kitronik Motor Control board is to control two motors in PWM mode. They use P0, P8, P12 and P16 currently in digital mode but now thanks to micro Python in analogue mode. All the best David Booth On 20 December 2016 at 23:26, Damien George wrote: > No, at the moment there is no function to tell how much space is left > on the internal filesystem. > > In CPython, and upstream MicroPython, one uses the os.statvfs() > function which returns a bunch of information, like number of free > blocks, free inodes, block size. etc. Then you compute the free space > by using block_size * num_free_blocks. > > Arguably, one would want a simpler function for microbit users. > > On 21 December 2016 at 08:37, David Whale > wrote: > > Is there a way to find out how much free space there is on the filing > > system? I can't see anything in the API docs, the best I can see is to > try > > to write to a file and see if it fails. However, it would be helpful to > know > > in advance of writing how much space is left. > > > > Thanks > > > > David > > > > microbit.org-ticket: 460 > > > > > > > > _______________________________________________ > > 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.f.booth at googlemail.com Wed Dec 21 06:00:35 2016 From: david.f.booth at googlemail.com (David Booth) Date: Wed, 21 Dec 2016 11:00:35 +0000 Subject: [Microbit-Python] List of error codes and their meanings In-Reply-To: References: Message-ID: Hi Damien Thank you for that information. I think that this ticket 460 can be closed now. Happy Christmas David Booth On 20 December 2016 at 23:31, Damien George wrote: > There are many exceptions and they can occur for many reasons. Almost > all are based on CPython and the exceptions form a hierarchy. Eg, > indexing a list with an out-of-bounds index will raise IndexError, > which derives from LookupError, which derives from Exception, which > derives from BaseException. > > For a list of implemented exceptions in MicroPython see > https://github.com/bbcmicrobit/micropython/blob/ > master/source/py/objexcept.c#L192-L280 > > On 21 December 2016 at 08:35, David Whale > wrote: > > Is there anything in the docs that lists all the errors (exceptions) that > > can occur in MicroPython and what they mean? > > > > The closest I found was this: > > > > https://github.com/bbcmicrobit/micropython/blob/ > a20fbe82c919cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h > > > > > > Thanks > > > > David > > > > microbit.org-ticket: 460 > > > > > > > > _______________________________________________ > > 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 Wed Dec 21 06:06:03 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Wed, 21 Dec 2016 11:06:03 +0000 Subject: [Microbit-Python] List of error codes and their meanings In-Reply-To: References: Message-ID: <71965594-edb9-2977-0e49-5d4137f9edb8@ntoll.org> David, MicroPython is just like "normal" Python in terms of what the various exceptions mean. I.e. it's a more-or-less conformant version of Python 3. See: https://docs.python.org/3.5/library/exceptions.html I imagine there may be some reductions / minor differences in what MicroPython actually provides, because of running on constrained devices ~ but, as a Pythonista, it's always felt just like "normal" Python to me in this regard. This is "a good thing" (tm). N. On 20/12/16 21:35, David Whale wrote: > Is there anything in the docs that lists all the errors (exceptions) > that can occur in MicroPython and what they mean? > > The closest I found was this: > > https://github.com/bbcmicrobit/micropython/blob/a20fbe82c919cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h > > > Thanks > > David > > microbit.org-ticket: 460 > > > > > _______________________________________________ > 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: 455 bytes Desc: OpenPGP digital signature URL: From david.f.booth at googlemail.com Wed Dec 21 06:18:31 2016 From: david.f.booth at googlemail.com (David Booth) Date: Wed, 21 Dec 2016 11:18:31 +0000 Subject: [Microbit-Python] List of error codes and their meanings In-Reply-To: <71965594-edb9-2977-0e49-5d4137f9edb8@ntoll.org> References: <71965594-edb9-2977-0e49-5d4137f9edb8@ntoll.org> Message-ID: Hi Nicholas Thank you for your response. I came across the use of the word exceptions without understanding what it implied. Happy Christmas David On 21 December 2016 at 11:06, Nicholas H.Tollervey wrote: > David, > > MicroPython is just like "normal" Python in terms of what the various > exceptions mean. I.e. it's a more-or-less conformant version of Python 3. > > See: > > https://docs.python.org/3.5/library/exceptions.html > > I imagine there may be some reductions / minor differences in what > MicroPython actually provides, because of running on constrained devices > ~ but, as a Pythonista, it's always felt just like "normal" Python to me > in this regard. > > This is "a good thing" (tm). > > N. > > On 20/12/16 21:35, David Whale wrote: > > Is there anything in the docs that lists all the errors (exceptions) > > that can occur in MicroPython and what they mean? > > > > The closest I found was this: > > > > https://github.com/bbcmicrobit/micropython/blob/ > a20fbe82c919cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h > > > > > > Thanks > > > > David > > > > microbit.org-ticket: 460 > > > > > > > > > > _______________________________________________ > > 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 arose85618 at aol.com Wed Dec 21 16:52:11 2016 From: arose85618 at aol.com (Austen Rose) Date: Wed, 21 Dec 2016 16:52:11 -0500 Subject: [Microbit-Python] micro:bit - communications with a PC In-Reply-To: <158e0734e69-5615-2574@webprd-a65.mail.aol.com> References: <158e0734e69-5615-2574@webprd-a65.mail.aol.com> Message-ID: <159235eca1d-614b-15d89@webprd-a67.mail.aol.com> Hi All, I am a recent user of the micro:bit, so apologies for possibly silly question: Is there any way of using the USB port, or the bluetooth network, or any other connection to interface to a PC? And are there any code examples out there? Thanks, Austen -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.f.booth at googlemail.com Thu Dec 22 04:14:59 2016 From: david.f.booth at googlemail.com (David Booth) Date: Thu, 22 Dec 2016 09:14:59 +0000 Subject: [Microbit-Python] micro:bit - communications with a PC In-Reply-To: <159235eca1d-614b-15d89@webprd-a67.mail.aol.com> References: <158e0734e69-5615-2574@webprd-a65.mail.aol.com> <159235eca1d-614b-15d89@webprd-a67.mail.aol.com> Message-ID: Hi Austen Couple your micro:bit to your PC using a USB cable with the appropriate ends (if you bought the full kit micro:bit it came with a short cable but most Smart phone USB charger cables will work). Then in your web browser (say Chrome - not all work) go to www.microbit.org and click "Lets Code". You get a choice of Microsoft PXT ( a form of block code with radio link option), Python (two versions and includes radio links), Block Code, Java Script, Microsoft Touch Development. All have documentation. Select the language you are most familiar with but if you want the easiest try the Block Editor which is just drag and drop like building Lego. It has a micro:bit emulator which is easy to run to check your script (programme). Happy programming David On 21 December 2016 at 21:52, Austen Rose via Microbit wrote: > Hi All, > > I am a recent user of the micro:bit, so apologies for possibly silly > question: > > Is there any way of using the USB port, or the bluetooth network, or any > other connection to interface to a PC? And are there any code examples out > there? > > > Thanks, Austen > > > _______________________________________________ > 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 Thu Dec 22 04:18:38 2016 From: ntoll at ntoll.org (Nicholas H.Tollervey) Date: Thu, 22 Dec 2016 09:18:38 +0000 Subject: [Microbit-Python] micro:bit - communications with a PC In-Reply-To: <159235eca1d-614b-15d89@webprd-a67.mail.aol.com> References: <158e0734e69-5615-2574@webprd-a65.mail.aol.com> <159235eca1d-614b-15d89@webprd-a67.mail.aol.com> Message-ID: <4dcf803e-ef36-4d82-e004-b4ec095b5f9b@ntoll.org> Hi Austen, On 21/12/16 21:52, Austen Rose via Microbit wrote: > Hi All, > > I am a recent user of the micro:bit, so apologies for possibly silly > question: > No need to apologise - the only silly question is the one you never ask. ;-) > Is there any way of using the USB port, or the bluetooth network, or any > other connection to interface to a PC? And are there any code examples > out there? > Yes. What exactly are you trying to achieve? I ask simply because there are various options and I don't want to brain-dump a bunch of stuff that isn't appropriate to the problem you want to solve. If you use the Mu editor (https://codewith.mu/) you'll be able to "talk" directly with the device via the REPL (assuming you have MicroPython flashed onto the device). Using uart you'll be able to push data from the device down USB to the "host" computer. Best wishes, N. > > Thanks, Austen > > > > _______________________________________________ > 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: 455 bytes Desc: OpenPGP digital signature URL: From david.f.booth at googlemail.com Fri Dec 23 10:09:17 2016 From: david.f.booth at googlemail.com (David Booth) Date: Fri, 23 Dec 2016 15:09:17 +0000 Subject: [Microbit-Python] List of error codes and their meanings In-Reply-To: References: Message-ID: Hi Damien I have a related question regarding run time errors in micro Python. I have three micro:bits. The first I call Rx because it basically receives x axis acceleration data in string form, via the radio from the other two micro:bits Tx1 and Tx2. Rx poles Tx1 then Tx2 with 100 ms gaps. Nicholas Tollervey showed me how to avoid the Type None error when converting the string to an integer in RX and I now have three simple script which enable Rx to drive pins P0 (from Tx1) and P8 (from Tx2) with a PWM signal. However after running perfectly well for anything from 10 seconds to a minute Rx freezes. On the very few occasions an error message has scrolled it appears to be saying that "received is not a string" and possibly there is a value error. However on 98% of occasions Rx is frozen to the extent it cannot report the error. Since spurious errors do not worry me, provided Rx continues with the polling loop, is it possible to suppress catching run time errors and if it is possible is it likely that the While loop would continue? Sometimes pressing reset restarts the system but sometimes I have to remove the battery. Thank you and a Happy Christmas David Booth ps will you be at BETT? On 20 December 2016 at 23:31, Damien George wrote: > There are many exceptions and they can occur for many reasons. Almost > all are based on CPython and the exceptions form a hierarchy. Eg, > indexing a list with an out-of-bounds index will raise IndexError, > which derives from LookupError, which derives from Exception, which > derives from BaseException. > > For a list of implemented exceptions in MicroPython see > https://github.com/bbcmicrobit/micropython/blob/ > master/source/py/objexcept.c#L192-L280 > > On 21 December 2016 at 08:35, David Whale > wrote: > > Is there anything in the docs that lists all the errors (exceptions) that > > can occur in MicroPython and what they mean? > > > > The closest I found was this: > > > > https://github.com/bbcmicrobit/micropython/blob/ > a20fbe82c919cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h > > > > > > Thanks > > > > David > > > > microbit.org-ticket: 460 > > > > > > > > _______________________________________________ > > 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 nevil.hunt at hotmail.co.uk Fri Dec 23 13:44:52 2016 From: nevil.hunt at hotmail.co.uk (Nevil Hunt) Date: Fri, 23 Dec 2016 18:44:52 +0000 Subject: [Microbit-Python] List of error codes and their meanings In-Reply-To: References: , Message-ID: Hi David, I've also encountered some similar symptoms this week, namely a micro:bit locking up such that a reset doesn't bring it back to life. Only a power cycle brings it back to life. My set-up has some similarities with yours in that I'm sending Radio commands from one micro:bit to another using the suggested method of "radio.send(str(x))" with the receiving micro:bit locking up from time to time. However I think the lockups might not be due to the Radio commands. I too have the receiving micro:bit driving pins with PWM (in my case Servos) and with a bit of experimenting it looks like it might be these "pin1.write_analog(x_angle)" commands that are causing the lock-ups since by commenting out these "write_analog" commands (but with all the Radio commands still running) it hasn't locked up in over an hour. By comparison, with the "write_analog" commands still active, ~5 mins is the longest it runs without locking up. Maybe you could see if commenting out the "write_analog" commands on your setup has the same effects. It may not stop other errors but I'd be interested to see if it stops the lock-ups. Cheers, Nevil ________________________________ From: Microbit on behalf of David Booth via Microbit Sent: 23 December 2016 15:09 To: For Pythonic MicroBit related discussions Cc: David Booth Subject: Re: [Microbit-Python] List of error codes and their meanings Hi Damien I have a related question regarding run time errors in micro Python. I have three micro:bits. The first I call Rx because it basically receives x axis acceleration data in string form, via the radio from the other two micro:bits Tx1 and Tx2. Rx poles Tx1 then Tx2 with 100 ms gaps. Nicholas Tollervey showed me how to avoid the Type None error when converting the string to an integer in RX and I now have three simple script which enable Rx to drive pins P0 (from Tx1) and P8 (from Tx2) with a PWM signal. However after running perfectly well for anything from 10 seconds to a minute Rx freezes. On the very few occasions an error message has scrolled it appears to be saying that "received is not a string" and possibly there is a value error. However on 98% of occasions Rx is frozen to the extent it cannot report the error. Since spurious errors do not worry me, provided Rx continues with the polling loop, is it possible to suppress catching run time errors and if it is possible is it likely that the While loop would continue? Sometimes pressing reset restarts the system but sometimes I have to remove the battery. Thank you and a Happy Christmas David Booth ps will you be at BETT? On 20 December 2016 at 23:31, Damien George > wrote: There are many exceptions and they can occur for many reasons. Almost all are based on CPython and the exceptions form a hierarchy. Eg, indexing a list with an out-of-bounds index will raise IndexError, which derives from LookupError, which derives from Exception, which derives from BaseException. For a list of implemented exceptions in MicroPython see https://github.com/bbcmicrobit/micropython/blob/master/source/py/objexcept.c#L192-L280 On 21 December 2016 at 08:35, David Whale > wrote: > Is there anything in the docs that lists all the errors (exceptions) that > can occur in MicroPython and what they mean? > > The closest I found was this: > > https://github.com/bbcmicrobit/micropython/blob/a20fbe82c919cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h > > > Thanks > > David > > microbit.org-ticket: 460 > > > > _______________________________________________ > 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 arose85618 at aol.com Fri Dec 23 18:09:52 2016 From: arose85618 at aol.com (Austen Rose) Date: Fri, 23 Dec 2016 18:09:52 -0500 Subject: [Microbit-Python] micro:bit - communications with a PC Message-ID: <1592df29f3a-614b-1b67b@webprd-a67.mail.aol.com> Hi Nicholas, I have four microbits that communicate happily over radio, but what I want to do is be able to do is add my PC to the network. So if I have, for instance, my Linux PC as a master controller and then the microbits as slaves, then I could stream data to/from my PC and my microbit network. I am using the Mu editor. I don't really have a project in mind, but I'd like to explore the options. Thanks, Austen Rose arose85618 at aol.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From titimoby at gmail.com Sat Dec 24 04:28:13 2016 From: titimoby at gmail.com (Thierry Chantier) Date: Sat, 24 Dec 2016 09:28:13 +0000 Subject: [Microbit-Python] micro:bit - communications with a PC In-Reply-To: <1592df29f3a-614b-1b67b@webprd-a67.mail.aol.com> References: <1592df29f3a-614b-1b67b@webprd-a67.mail.aol.com> Message-ID: To do that, you'll have to find a way for the PC to communicate on the same radio frequency qith the same protocol. That could be nice. Le sam. 24 d?c. 2016 ? 00:15, Austen Rose via Microbit a ?crit : > Hi Nicholas, > > I have four microbits that communicate happily over radio, but what I want > to do is be able to do is add my PC to the network. So if I have, for > instance, my Linux PC as a master controller and then the microbits as > slaves, then I could stream data to/from my PC and my microbit network. > > I am using the Mu editor. I don't really have a project in mind, but I'd > like to explore the options. > > Thanks, > > Austen Rose > arose85618 at aol.com > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > -------------- next part -------------- An HTML attachment was scrubbed... URL: From loopspace at mathforge.org Sat Dec 24 05:51:29 2016 From: loopspace at mathforge.org (Loop Space) Date: Sat, 24 Dec 2016 10:51:29 +0000 Subject: [Microbit-Python] micro:bit - communications with a PC In-Reply-To: References: <1592df29f3a-614b-1b67b@webprd-a67.mail.aol.com> Message-ID: You could have another microbit attached to the PC as the receiving station. It would listen on the radio and pass on the messages via the usb cable. Andrew > On 24 Dec 2016, at 09:28, Thierry Chantier wrote: > > To do that, you'll have to find a way for the PC to communicate on the same radio frequency qith the same protocol. > That could be nice. > > >> Le sam. 24 d?c. 2016 ? 00:15, Austen Rose via Microbit a ?crit : >> Hi Nicholas, >> >> I have four microbits that communicate happily over radio, but what I want to do is be able to do is add my PC to the network. So if I have, for instance, my Linux PC as a master controller and then the microbits as slaves, then I could stream data to/from my PC and my microbit network. >> >> I am using the Mu editor. I don't really have a project in mind, but I'd like to explore the options. >> >> Thanks, >> >> Austen Rose >> arose85618 at aol.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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark at hotpy.org Sat Dec 24 06:23:21 2016 From: mark at hotpy.org (Mark Shannon) Date: Sat, 24 Dec 2016 11:23:21 +0000 Subject: [Microbit-Python] List of error codes and their meanings In-Reply-To: References: Message-ID: <2d926e14-67d7-7790-5ea0-4cf33824aaf9@hotpy.org> Hi David and Nevil, Thanks for the debugging. To prevent this information getting lost could you open an issue on github. https://github.com/bbcmicrobit/micropython/issues/new That way all the information is in one place, which will make things a lot easier for me to diagnose and fix the problem. Cheers, Mark. On 23/12/16 18:44, Nevil Hunt wrote: > Hi David, > > > I've also encountered some similar symptoms this week, namely a > micro:bit locking up such that a reset doesn't bring it back to life. > Only a power cycle brings it back to life. > > > My set-up has some similarities with yours in that I'm sending Radio > commands from one micro:bit to another using the suggested method of > "radio.send(str(x))" with the receiving micro:bit locking up from time > to time. However I think the lockups might not be due to the Radio > commands. I too have the receiving micro:bit driving pins with PWM (in > my case Servos) and with a bit of experimenting it looks like it might > be these "pin1.write_analog(x_angle)" commands that are causing the > lock-ups since by commenting out these "write_analog" commands (but with > all the Radio commands still running) it hasn't locked up in over an > hour. By comparison, with the "write_analog" commands still active, ~5 > mins is the longest it runs without locking up. > > > Maybe you could see if commenting out the "write_analog" commands on > your setup has the same effects. It may not stop other errors but I'd be > interested to see if it stops the lock-ups. > > > > Cheers, > > > Nevil > > > > > ------------------------------------------------------------------------ > *From:* Microbit > on behalf of David Booth via Microbit > *Sent:* 23 December 2016 15:09 > *To:* For Pythonic MicroBit related discussions > *Cc:* David Booth > *Subject:* Re: [Microbit-Python] List of error codes and their meanings > > Hi Damien > > I have a related question regarding run time errors in micro Python. > > I have three micro:bits. The first I call Rx because it basically > receives x axis acceleration data in string form, via the radio from the > other two micro:bits Tx1 and Tx2. Rx poles Tx1 then Tx2 with 100 ms > gaps. Nicholas Tollervey showed me how to avoid the Type None error when > converting the string to an integer in RX and I now have three simple > script which enable Rx to drive pins P0 (from Tx1) and P8 (from Tx2) > with a PWM signal. > > However after running perfectly well for anything from 10 seconds to a > minute Rx freezes. On the very few occasions an error message has > scrolled it appears to be saying that "received is not a string" and > possibly there is a value error. However on 98% of occasions Rx is > frozen to the extent it cannot report the error. Since spurious errors > do not worry me, provided Rx continues with the polling loop, is it > possible to suppress catching run time errors and if it is possible is > it likely that the While loop would continue? > > Sometimes pressing reset restarts the system but sometimes I have to > remove the battery. > > Thank you and a Happy Christmas > David Booth > ps will you be at BETT? > > > On 20 December 2016 at 23:31, Damien George > wrote: > > There are many exceptions and they can occur for many reasons. Almost > all are based on CPython and the exceptions form a hierarchy. Eg, > indexing a list with an out-of-bounds index will raise IndexError, > which derives from LookupError, which derives from Exception, which > derives from BaseException. > > For a list of implemented exceptions in MicroPython see > https://github.com/bbcmicrobit/micropython/blob/master/source/py/objexcept.c#L192-L280 > > > On 21 December 2016 at 08:35, David Whale > > wrote: > > Is there anything in the docs that lists all the errors > (exceptions) that > > can occur in MicroPython and what they mean? > > > > The closest I found was this: > > > > > https://github.com/bbcmicrobit/micropython/blob/a20fbe82c919cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h > > > > > > > Thanks > > > > David > > > > microbit.org-ticket: 460 > > > > > > > > _______________________________________________ > > 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 ben at benmr.com Sat Dec 24 08:21:18 2016 From: ben at benmr.com (Ben Mustill-Rose) Date: Sat, 24 Dec 2016 13:21:18 +0000 Subject: [Microbit-Python] micro:bit - communications with a PC In-Reply-To: References: <1592df29f3a-614b-1b67b@webprd-a67.mail.aol.com> Message-ID: Hi, As has been suggested you could connect a micro:bit to your computer that receives messages via radio then prints them to serial for the computer to act upon. the pySerial package would be a good place to start if you wanted to go down this root - I've done similar things to this before with good results. Alternatively, if you're up for a fair amount of hacking, I believe this https://www.amazon.co.uk/Bluefruit-Friend-Bluetooth-Energy-nRF51822/dp/B0137IE3GI/ref=sr_1_5?ie=UTF8&qid=1482584673&sr=8-5&keywords=nrf51822 device could be made to talk to the micro:bit. Cheers, Ben. On 12/24/16, Loop Space wrote: > You could have another microbit attached to the PC as the receiving station. > It would listen on the radio and pass on the messages via the usb cable. > > Andrew > >> On 24 Dec 2016, at 09:28, Thierry Chantier wrote: >> >> To do that, you'll have to find a way for the PC to communicate on the >> same radio frequency qith the same protocol. >> That could be nice. >> >> >>> Le sam. 24 d?c. 2016 ? 00:15, Austen Rose via Microbit >>> a ?crit : >>> Hi Nicholas, >>> >>> I have four microbits that communicate happily over radio, but what I >>> want to do is be able to do is add my PC to the network. So if I have, >>> for instance, my Linux PC as a master controller and then the microbits >>> as slaves, then I could stream data to/from my PC and my microbit >>> network. >>> >>> I am using the Mu editor. I don't really have a project in mind, but I'd >>> like to explore the options. >>> >>> Thanks, >>> >>> Austen Rose >>> arose85618 at aol.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 arose85618 at aol.com Sat Dec 24 09:24:02 2016 From: arose85618 at aol.com (Austen Rose) Date: Sat, 24 Dec 2016 09:24:02 -0500 Subject: [Microbit-Python] micro:bit - communications with a PC In-Reply-To: Message-ID: <15931379269-614b-1c2d8@webprd-a67.mail.aol.com> And just to be sure, the best way for direct communication from a PC to an app running on my microbit is over USB, via REPL? Thanks all for the help and thoughts. Austen Rose arose85618 at aol.com -----Original Message----- From: Loop Space To: For Pythonic MicroBit related discussions CC: Austen Rose Sent: Sat, 24 Dec 2016 10:51 Subject: Re: [Microbit-Python] micro:bit - communications with a PC You could have another microbit attached to the PC as the receiving station. It would listen on the radio and pass on the messages via the usb cable. Andrew On 24 Dec 2016, at 09:28, Thierry Chantier wrote: To do that, you'll have to find a way for the PC to communicate on the same radio frequency qith the same protocol. That could be nice. Le sam. 24 d?c. 2016 ? 00:15, Austen Rose via Microbit a ?crit : Hi Nicholas, I have four microbits that communicate happily over radio, but what I want to do is be able to do is add my PC to the network. So if I have, for instance, my Linux PC as a master controller and then the microbits as slaves, then I could stream data to/from my PC and my microbit network. I am using the Mu editor. I don't really have a project in mind, but I'd like to explore the options. Thanks, Austen Rose arose85618 at aol.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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at benmr.com Sat Dec 24 11:50:13 2016 From: ben at benmr.com (Ben Mustill-Rose) Date: Sat, 24 Dec 2016 16:50:13 +0000 Subject: [Microbit-Python] micro:bit - communications with a PC In-Reply-To: <15931379269-614b-1c2d8@webprd-a67.mail.aol.com> References: <15931379269-614b-1c2d8@webprd-a67.mail.aol.com> Message-ID: It's probably the easiest yes. On 12/24/16, Austen Rose via Microbit wrote: > And just to be sure, the best way for direct communication from a PC to an > app running on my microbit is over USB, via REPL? > > > Thanks all for the help and thoughts. > > > Austen Rose > arose85618 at aol.com > > > > > > -----Original Message----- > From: Loop Space > To: For Pythonic MicroBit related discussions > CC: Austen Rose > Sent: Sat, 24 Dec 2016 10:51 > Subject: Re: [Microbit-Python] micro:bit - communications with a PC > > > > > You could have another microbit attached to the PC as the receiving station. > It would listen on the radio and pass on the messages via the usb cable. > > > Andrew > > On 24 Dec 2016, at 09:28, Thierry Chantier wrote: > > > > > To do that, you'll have to find a way for the PC to communicate on the same > radio frequency qith the same protocol. > > That could be nice. > > > > > Le sam. 24 d?c. 2016 ? 00:15, Austen Rose via Microbit > a ?crit : > > > Hi Nicholas, > > I have four microbits that communicate happily over radio, but what I want > to do is be able to do is add my PC to the network. So if I have, for > instance, my Linux PC as a master controller and then the microbits as > slaves, then I could stream data to/from my PC and my microbit network. > > I am using the Mu editor. I don't really have a project in mind, but I'd > like to explore the options. > > Thanks, > > > Austen Rose > arose85618 at aol.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 david at thinkingbinaries.com Sat Dec 24 12:31:06 2016 From: david at thinkingbinaries.com (David Whale) Date: Sat, 24 Dec 2016 17:31:06 +0000 Subject: [Microbit-Python] micro:bit - communications with a PC In-Reply-To: <15931379269-614b-1c2d8@webprd-a67.mail.aol.com> References: <15931379269-614b-1c2d8@webprd-a67.mail.aol.com> Message-ID: Jonny and I made a 41 micro:bit tone-matrix using this Python code below, that we showed at ARM TechCon this year. https://github.com/whaleygeek/tonematrix There were 40 micro:bits working via the radio interface, and a 41st micro:bit acted as a gateway between the radio network and the USB serial on a Raspberry Pi. There is a version of pyserial embedded inside this project, so feel free to lift the 'microbit' folder as it does all the hard work of connecting to the microbit and managing state etc etc. The Raspberry Pi uses pygame to play musical chords through a speaker. The 40 micro:bits form a 5x8 matrix that you can use to turn on and of specific notes at specific positions. Here is a very short video that ARMEmbedded tweeted from the show: https://twitter.com/ARMEmbedded/status/791346934644609024 David On 24 December 2016 at 14:24, Austen Rose via Microbit wrote: > And just to be sure, the best way for direct communication from a PC to > an app running on my microbit is over USB, via REPL? > > Thanks all for the help and thoughts. > > Austen Rose > arose85618 at aol.com > > > -----Original Message----- > From: Loop Space > To: For Pythonic MicroBit related discussions > CC: Austen Rose > Sent: Sat, 24 Dec 2016 10:51 > Subject: Re: [Microbit-Python] micro:bit - communications with a PC > > You could have another microbit attached to the PC as the receiving > station. It would listen on the radio and pass on the messages via the usb > cable. > > Andrew > > On 24 Dec 2016, at 09:28, Thierry Chantier wrote: > > To do that, you'll have to find a way for the PC to communicate on the > same radio frequency qith the same protocol. > That could be nice. > > > Le sam. 24 d?c. 2016 ? 00:15, Austen Rose via Microbit < > microbit at python.org> a ?crit : > >> Hi Nicholas, >> >> I have four microbits that communicate happily over radio, but what I >> want to do is be able to do is add my PC to the network. So if I have, for >> instance, my Linux PC as a master controller and then the microbits as >> slaves, then I could stream data to/from my PC and my microbit network. >> >> I am using the Mu editor. I don't really have a project in mind, but I'd >> like to explore the options. >> >> Thanks, >> >> Austen Rose >> arose85618 at aol.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 > > > _______________________________________________ > Microbit mailing list > Microbit at python.org > https://mail.python.org/mailman/listinfo/microbit > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.f.booth at googlemail.com Sat Dec 24 12:50:59 2016 From: david.f.booth at googlemail.com (David Booth) Date: Sat, 24 Dec 2016 17:50:59 +0000 Subject: [Microbit-Python] List of error codes and their meanings In-Reply-To: <2d926e14-67d7-7790-5ea0-4cf33824aaf9@hotpy.org> References: <2d926e14-67d7-7790-5ea0-4cf33824aaf9@hotpy.org> Message-ID: Hi Mark I am new to github but will try. David On 24 December 2016 at 11:23, Mark Shannon wrote: > Hi David and Nevil, > > Thanks for the debugging. > To prevent this information getting lost could you open an issue on github. > https://github.com/bbcmicrobit/micropython/issues/new > > That way all the information is in one place, which will make things a lot > easier for me to diagnose and fix the problem. > > Cheers, > Mark. > > On 23/12/16 18:44, Nevil Hunt wrote: > >> Hi David, >> >> >> I've also encountered some similar symptoms this week, namely a >> micro:bit locking up such that a reset doesn't bring it back to life. >> Only a power cycle brings it back to life. >> >> >> My set-up has some similarities with yours in that I'm sending Radio >> commands from one micro:bit to another using the suggested method of >> "radio.send(str(x))" with the receiving micro:bit locking up from time >> to time. However I think the lockups might not be due to the Radio >> commands. I too have the receiving micro:bit driving pins with PWM (in >> my case Servos) and with a bit of experimenting it looks like it might >> be these "pin1.write_analog(x_angle)" commands that are causing the >> lock-ups since by commenting out these "write_analog" commands (but with >> all the Radio commands still running) it hasn't locked up in over an >> hour. By comparison, with the "write_analog" commands still active, ~5 >> mins is the longest it runs without locking up. >> >> >> Maybe you could see if commenting out the "write_analog" commands on >> your setup has the same effects. It may not stop other errors but I'd be >> interested to see if it stops the lock-ups. >> >> >> >> Cheers, >> >> >> Nevil >> >> >> >> >> ------------------------------------------------------------------------ >> *From:* Microbit >> on behalf of David Booth via Microbit >> *Sent:* 23 December 2016 15:09 >> *To:* For Pythonic MicroBit related discussions >> *Cc:* David Booth >> *Subject:* Re: [Microbit-Python] List of error codes and their meanings >> >> Hi Damien >> >> I have a related question regarding run time errors in micro Python. >> >> I have three micro:bits. The first I call Rx because it basically >> receives x axis acceleration data in string form, via the radio from the >> other two micro:bits Tx1 and Tx2. Rx poles Tx1 then Tx2 with 100 ms >> gaps. Nicholas Tollervey showed me how to avoid the Type None error when >> converting the string to an integer in RX and I now have three simple >> script which enable Rx to drive pins P0 (from Tx1) and P8 (from Tx2) >> with a PWM signal. >> >> However after running perfectly well for anything from 10 seconds to a >> minute Rx freezes. On the very few occasions an error message has >> scrolled it appears to be saying that "received is not a string" and >> possibly there is a value error. However on 98% of occasions Rx is >> frozen to the extent it cannot report the error. Since spurious errors >> do not worry me, provided Rx continues with the polling loop, is it >> possible to suppress catching run time errors and if it is possible is >> it likely that the While loop would continue? >> >> Sometimes pressing reset restarts the system but sometimes I have to >> remove the battery. >> >> Thank you and a Happy Christmas >> David Booth >> ps will you be at BETT? >> >> >> On 20 December 2016 at 23:31, Damien George > > wrote: >> >> There are many exceptions and they can occur for many reasons. Almost >> all are based on CPython and the exceptions form a hierarchy. Eg, >> indexing a list with an out-of-bounds index will raise IndexError, >> which derives from LookupError, which derives from Exception, which >> derives from BaseException. >> >> For a list of implemented exceptions in MicroPython see >> https://github.com/bbcmicrobit/micropython/blob/master/ >> source/py/objexcept.c#L192-L280 >> > source/py/objexcept.c#L192-L280> >> >> On 21 December 2016 at 08:35, David Whale >> > >> wrote: >> > Is there anything in the docs that lists all the errors >> (exceptions) that >> > can occur in MicroPython and what they mean? >> > >> > The closest I found was this: >> > >> > >> https://github.com/bbcmicrobit/micropython/blob/a20fbe82c919 >> cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h >> > 9cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h> >> > >> > >> > Thanks >> > >> > David >> > >> > microbit.org-ticket: 460 >> > >> > >> > >> > _______________________________________________ >> > 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 stewart at penguintutor.com Sat Dec 24 14:01:48 2016 From: stewart at penguintutor.com (Stewart Watkiss) Date: Sat, 24 Dec 2016 19:01:48 +0000 Subject: [Microbit-Python] micro:bit - communications with a PC In-Reply-To: References: Message-ID: <01cf8e74-cdc3-38a4-bee2-533374362435@penguintutor.com> >> On 24 Dec 2016, at 09:28, Thierry Chantier wrote: >> >> To do that, you'll have to find a way for the PC to communicate on the same radio frequency qith the same protocol. >> That could be nice. >> >> >>> Le sam. 24 d?c. 2016 ? 00:15, Austen Rose via Microbit a ?crit : >>> Hi Nicholas, >>> >>> I have four microbits that communicate happily over radio, but what I want to do is be able to do is add my PC to the network. So if I have, for instance, my Linux PC as a master controller and then the microbits as slaves, then I could stream data to/from my PC and my microbit network. >>> >>> I am using the Mu editor. I don't really have a project in mind, but I'd like to explore the options. >>> >>> Thanks, >>> >>> Austen Rose >>> arose85618 at aol.com >>> _______________________________________________ >>> It's fairly straight forward to communicate between a PC and microbit using serial over the USB port. I have created something along those lines here: http://www.penguintutor.com/news/electronics/microbit-rpirobot That code is based on the micro:bit using USB serial as a console. So if you use a "print" on the microbit then you can readline it on the PC. That works one-way only, but you could use normal serial communications for bidirectional communications. I did start to look at whether it would be possible to communicate between the micro:bit and a Raspberry Pi using the native radio on the micro:bit and a nRF24L01 on the Raspberry Pi. Unfortunately I wasn't able to get it working when I first tried and due to other commitments haven't had time to pursue that any further. In theory it should be possible, but I wasn't able to get any of the available libraries for the RPi to work and haven't had time to create my own / modify the existing code. Regards Stewart @stewartwatkiss From loopspace at mathforge.org Sat Dec 24 15:38:35 2016 From: loopspace at mathforge.org (Loop Space) Date: Sat, 24 Dec 2016 20:38:35 +0000 Subject: [Microbit-Python] micro:bit - communications with a PC In-Reply-To: <01cf8e74-cdc3-38a4-bee2-533374362435@penguintutor.com> References: <01cf8e74-cdc3-38a4-bee2-533374362435@penguintutor.com> Message-ID: <3bdb59da-3bcb-c358-b5fe-ecfb4608ce55@mathforge.org> Here's something I had a go with for two microbits and a PC. https://github.com/loopspace/microbit/tree/master/turtle mb_radio_sender.py is for the free-standing microbit. It takes readings from various sensors and packages them into a message. mb_radio_receiver.py is for the microbit connected to the PC, it simply receives messages and prints them out through the USB. turtleclient.py is for the PC, it reads from the serial port and then decodes the message which it uses for instructions to a turtle. You'll need to change the serial port on line 7. (the other files were part of experimenting) It needs a couple of libraries: pySerial and numpy (turtle seems to be part of the python3 package, but if not you'd need to install that too) Best, Andrew From damien.p.george at gmail.com Wed Dec 28 23:16:57 2016 From: damien.p.george at gmail.com (Damien George) Date: Thu, 29 Dec 2016 15:16:57 +1100 Subject: [Microbit-Python] List of error codes and their meanings In-Reply-To: References: <2d926e14-67d7-7790-5ea0-4cf33824aaf9@hotpy.org> Message-ID: Hi David, You should be able to catch all your errors using "try:... except:..." blocks and use that to keep the while loop running for a much longer time. But it could be related to surges in power supply... do you get the error if you don't have anything connected to the microbits, ie you are not driving anything with PWM? Cheers, Damien. On 25 December 2016 at 04:50, David Booth via Microbit wrote: > Hi Mark > I am new to github but will try. > David > > On 24 December 2016 at 11:23, Mark Shannon wrote: >> >> Hi David and Nevil, >> >> Thanks for the debugging. >> To prevent this information getting lost could you open an issue on >> github. >> https://github.com/bbcmicrobit/micropython/issues/new >> >> That way all the information is in one place, which will make things a lot >> easier for me to diagnose and fix the problem. >> >> Cheers, >> Mark. >> >> On 23/12/16 18:44, Nevil Hunt wrote: >>> >>> Hi David, >>> >>> >>> I've also encountered some similar symptoms this week, namely a >>> micro:bit locking up such that a reset doesn't bring it back to life. >>> Only a power cycle brings it back to life. >>> >>> >>> My set-up has some similarities with yours in that I'm sending Radio >>> commands from one micro:bit to another using the suggested method of >>> "radio.send(str(x))" with the receiving micro:bit locking up from time >>> to time. However I think the lockups might not be due to the Radio >>> commands. I too have the receiving micro:bit driving pins with PWM (in >>> my case Servos) and with a bit of experimenting it looks like it might >>> be these "pin1.write_analog(x_angle)" commands that are causing the >>> lock-ups since by commenting out these "write_analog" commands (but with >>> all the Radio commands still running) it hasn't locked up in over an >>> hour. By comparison, with the "write_analog" commands still active, ~5 >>> mins is the longest it runs without locking up. >>> >>> >>> Maybe you could see if commenting out the "write_analog" commands on >>> your setup has the same effects. It may not stop other errors but I'd be >>> interested to see if it stops the lock-ups. >>> >>> >>> >>> Cheers, >>> >>> >>> Nevil >>> >>> >>> >>> >>> ------------------------------------------------------------------------ >>> *From:* Microbit >>> on behalf of David Booth via Microbit >>> *Sent:* 23 December 2016 15:09 >>> *To:* For Pythonic MicroBit related discussions >>> *Cc:* David Booth >>> *Subject:* Re: [Microbit-Python] List of error codes and their meanings >>> >>> Hi Damien >>> >>> I have a related question regarding run time errors in micro Python. >>> >>> I have three micro:bits. The first I call Rx because it basically >>> receives x axis acceleration data in string form, via the radio from the >>> other two micro:bits Tx1 and Tx2. Rx poles Tx1 then Tx2 with 100 ms >>> gaps. Nicholas Tollervey showed me how to avoid the Type None error when >>> converting the string to an integer in RX and I now have three simple >>> script which enable Rx to drive pins P0 (from Tx1) and P8 (from Tx2) >>> with a PWM signal. >>> >>> However after running perfectly well for anything from 10 seconds to a >>> minute Rx freezes. On the very few occasions an error message has >>> scrolled it appears to be saying that "received is not a string" and >>> possibly there is a value error. However on 98% of occasions Rx is >>> frozen to the extent it cannot report the error. Since spurious errors >>> do not worry me, provided Rx continues with the polling loop, is it >>> possible to suppress catching run time errors and if it is possible is >>> it likely that the While loop would continue? >>> >>> Sometimes pressing reset restarts the system but sometimes I have to >>> remove the battery. >>> >>> Thank you and a Happy Christmas >>> David Booth >>> ps will you be at BETT? >>> >>> >>> On 20 December 2016 at 23:31, Damien George >> > wrote: >>> >>> There are many exceptions and they can occur for many reasons. >>> Almost >>> all are based on CPython and the exceptions form a hierarchy. Eg, >>> indexing a list with an out-of-bounds index will raise IndexError, >>> which derives from LookupError, which derives from Exception, which >>> derives from BaseException. >>> >>> For a list of implemented exceptions in MicroPython see >>> >>> https://github.com/bbcmicrobit/micropython/blob/master/source/py/objexcept.c#L192-L280 >>> >>> >>> >>> On 21 December 2016 at 08:35, David Whale >>> > >>> wrote: >>> > Is there anything in the docs that lists all the errors >>> (exceptions) that >>> > can occur in MicroPython and what they mean? >>> > >>> > The closest I found was this: >>> > >>> > >>> >>> https://github.com/bbcmicrobit/micropython/blob/a20fbe82c919cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h >>> >>> >>> > >>> > >>> > Thanks >>> > >>> > David >>> > >>> > microbit.org-ticket: 460 >>> > >>> > >>> > >>> > _______________________________________________ >>> > 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 mark at hotpy.org Fri Dec 30 07:04:57 2016 From: mark at hotpy.org (Mark Shannon) Date: Fri, 30 Dec 2016 12:04:57 +0000 Subject: [Microbit-Python] Lock-up due to some combination of radio and pwm. In-Reply-To: References: Message-ID: <2f795150-c0fd-1787-a816-6f6bd398c275@hotpy.org> Hi Nevil and David, Could you please submit an issue for this. https://github.com/bbcmicrobit/micropython/issues/new It is frustrating knowing that there may be a problem, but not being able to fix it. All I need is a brief description of what goes wrong and, most importantly, some code that causes the problem. Cheers, Mark. On 23/12/16 18:44, Nevil Hunt wrote: > Hi David, > > > I've also encountered some similar symptoms this week, namely a > micro:bit locking up such that a reset doesn't bring it back to life. > Only a power cycle brings it back to life. > > > My set-up has some similarities with yours in that I'm sending Radio > commands from one micro:bit to another using the suggested method of > "radio.send(str(x))" with the receiving micro:bit locking up from time > to time. However I think the lockups might not be due to the Radio > commands. I too have the receiving micro:bit driving pins with PWM (in > my case Servos) and with a bit of experimenting it looks like it might > be these "pin1.write_analog(x_angle)" commands that are causing the > lock-ups since by commenting out these "write_analog" commands (but with > all the Radio commands still running) it hasn't locked up in over an > hour. By comparison, with the "write_analog" commands still active, ~5 > mins is the longest it runs without locking up. > > > Maybe you could see if commenting out the "write_analog" commands on > your setup has the same effects. It may not stop other errors but I'd be > interested to see if it stops the lock-ups. > > > > Cheers, > > > Nevil > > > > > ------------------------------------------------------------------------ > *From:* Microbit > on behalf of David Booth via Microbit > *Sent:* 23 December 2016 15:09 > *To:* For Pythonic MicroBit related discussions > *Cc:* David Booth > *Subject:* Re: [Microbit-Python] List of error codes and their meanings > > Hi Damien > > I have a related question regarding run time errors in micro Python. > > I have three micro:bits. The first I call Rx because it basically > receives x axis acceleration data in string form, via the radio from the > other two micro:bits Tx1 and Tx2. Rx poles Tx1 then Tx2 with 100 ms > gaps. Nicholas Tollervey showed me how to avoid the Type None error when > converting the string to an integer in RX and I now have three simple > script which enable Rx to drive pins P0 (from Tx1) and P8 (from Tx2) > with a PWM signal. > > However after running perfectly well for anything from 10 seconds to a > minute Rx freezes. On the very few occasions an error message has > scrolled it appears to be saying that "received is not a string" and > possibly there is a value error. However on 98% of occasions Rx is > frozen to the extent it cannot report the error. Since spurious errors > do not worry me, provided Rx continues with the polling loop, is it > possible to suppress catching run time errors and if it is possible is > it likely that the While loop would continue? > > Sometimes pressing reset restarts the system but sometimes I have to > remove the battery. > > Thank you and a Happy Christmas > David Booth > ps will you be at BETT? > > > On 20 December 2016 at 23:31, Damien George > wrote: > > There are many exceptions and they can occur for many reasons. Almost > all are based on CPython and the exceptions form a hierarchy. Eg, > indexing a list with an out-of-bounds index will raise IndexError, > which derives from LookupError, which derives from Exception, which > derives from BaseException. > > For a list of implemented exceptions in MicroPython see > https://github.com/bbcmicrobit/micropython/blob/master/source/py/objexcept.c#L192-L280 > > > On 21 December 2016 at 08:35, David Whale > > wrote: > > Is there anything in the docs that lists all the errors > (exceptions) that > > can occur in MicroPython and what they mean? > > > > The closest I found was this: > > > > > https://github.com/bbcmicrobit/micropython/blob/a20fbe82c919cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h > > > > > > > Thanks > > > > David > > > > microbit.org-ticket: 460 > > > > > > > > _______________________________________________ > > 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 jim at groklearning.com Fri Dec 30 21:43:43 2016 From: jim at groklearning.com (Jim Mussared) Date: Sat, 31 Dec 2016 13:43:43 +1100 Subject: [Microbit-Python] Lock-up due to some combination of radio and pwm. In-Reply-To: <2f795150-c0fd-1787-a816-6f6bd398c275@hotpy.org> References: <2f795150-c0fd-1787-a816-6f6bd398c275@hotpy.org> Message-ID: Maybe related -- https://github.com/bbcmicrobit/micropython/issues/380 (Summary - if you're using the firmware image in Mu/uFlash as of a few weeks ago, this may be already fixed) On 30 December 2016 at 23:04, Mark Shannon wrote: > Hi Nevil and David, > > Could you please submit an issue for this. > https://github.com/bbcmicrobit/micropython/issues/new > > It is frustrating knowing that there may be a problem, but not being able to > fix it. > All I need is a brief description of what goes wrong and, most importantly, > some code that causes the problem. > > Cheers, > Mark. > > On 23/12/16 18:44, Nevil Hunt wrote: >> >> Hi David, >> >> >> I've also encountered some similar symptoms this week, namely a >> micro:bit locking up such that a reset doesn't bring it back to life. >> Only a power cycle brings it back to life. >> >> >> My set-up has some similarities with yours in that I'm sending Radio >> commands from one micro:bit to another using the suggested method of >> "radio.send(str(x))" with the receiving micro:bit locking up from time >> to time. However I think the lockups might not be due to the Radio >> commands. I too have the receiving micro:bit driving pins with PWM (in >> my case Servos) and with a bit of experimenting it looks like it might >> be these "pin1.write_analog(x_angle)" commands that are causing the >> lock-ups since by commenting out these "write_analog" commands (but with >> all the Radio commands still running) it hasn't locked up in over an >> hour. By comparison, with the "write_analog" commands still active, ~5 >> mins is the longest it runs without locking up. >> >> >> Maybe you could see if commenting out the "write_analog" commands on >> your setup has the same effects. It may not stop other errors but I'd be >> interested to see if it stops the lock-ups. >> >> >> >> Cheers, >> >> >> Nevil >> >> >> >> >> ------------------------------------------------------------------------ >> *From:* Microbit >> on behalf of David Booth via Microbit >> *Sent:* 23 December 2016 15:09 >> *To:* For Pythonic MicroBit related discussions >> *Cc:* David Booth >> *Subject:* Re: [Microbit-Python] List of error codes and their meanings >> >> Hi Damien >> >> I have a related question regarding run time errors in micro Python. >> >> I have three micro:bits. The first I call Rx because it basically >> receives x axis acceleration data in string form, via the radio from the >> other two micro:bits Tx1 and Tx2. Rx poles Tx1 then Tx2 with 100 ms >> gaps. Nicholas Tollervey showed me how to avoid the Type None error when >> converting the string to an integer in RX and I now have three simple >> script which enable Rx to drive pins P0 (from Tx1) and P8 (from Tx2) >> with a PWM signal. >> >> However after running perfectly well for anything from 10 seconds to a >> minute Rx freezes. On the very few occasions an error message has >> scrolled it appears to be saying that "received is not a string" and >> possibly there is a value error. However on 98% of occasions Rx is >> frozen to the extent it cannot report the error. Since spurious errors >> do not worry me, provided Rx continues with the polling loop, is it >> possible to suppress catching run time errors and if it is possible is >> it likely that the While loop would continue? >> >> Sometimes pressing reset restarts the system but sometimes I have to >> remove the battery. >> >> Thank you and a Happy Christmas >> David Booth >> ps will you be at BETT? >> >> >> On 20 December 2016 at 23:31, Damien George > > wrote: >> >> There are many exceptions and they can occur for many reasons. Almost >> all are based on CPython and the exceptions form a hierarchy. Eg, >> indexing a list with an out-of-bounds index will raise IndexError, >> which derives from LookupError, which derives from Exception, which >> derives from BaseException. >> >> For a list of implemented exceptions in MicroPython see >> >> https://github.com/bbcmicrobit/micropython/blob/master/source/py/objexcept.c#L192-L280 >> >> >> >> On 21 December 2016 at 08:35, David Whale >> > >> wrote: >> > Is there anything in the docs that lists all the errors >> (exceptions) that >> > can occur in MicroPython and what they mean? >> > >> > The closest I found was this: >> > >> > >> >> https://github.com/bbcmicrobit/micropython/blob/a20fbe82c919cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h >> >> >> > >> > >> > Thanks >> > >> > David >> > >> > microbit.org-ticket: 460 >> > >> > >> > >> > _______________________________________________ >> > 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 david.f.booth at googlemail.com Sat Dec 31 18:17:26 2016 From: david.f.booth at googlemail.com (David Booth) Date: Sat, 31 Dec 2016 23:17:26 +0000 Subject: [Microbit-Python] Lock-up due to some combination of radio and pwm. In-Reply-To: <2f795150-c0fd-1787-a816-6f6bd398c275@hotpy.org> References: <2f795150-c0fd-1787-a816-6f6bd398c275@hotpy.org> Message-ID: Hi Mark I have been having problems getting github to accept my input. It keeps asking me to verify my email address which I have done several times. So I have now re registered and submitted a comment. However it did not let me send .hex or .py files However you should know that in the interim Damien George has my hex files and has reproduced the problem. I have sent him my .py files so he can investigate further. Happy New Year David On 30 December 2016 at 12:04, Mark Shannon wrote: > Hi Nevil and David, > > Could you please submit an issue for this. > https://github.com/bbcmicrobit/micropython/issues/new > > It is frustrating knowing that there may be a problem, but not being able > to fix it. > All I need is a brief description of what goes wrong and, most > importantly, some code that causes the problem. > > Cheers, > Mark. > > On 23/12/16 18:44, Nevil Hunt wrote: > >> Hi David, >> >> >> I've also encountered some similar symptoms this week, namely a >> micro:bit locking up such that a reset doesn't bring it back to life. >> Only a power cycle brings it back to life. >> >> >> My set-up has some similarities with yours in that I'm sending Radio >> commands from one micro:bit to another using the suggested method of >> "radio.send(str(x))" with the receiving micro:bit locking up from time >> to time. However I think the lockups might not be due to the Radio >> commands. I too have the receiving micro:bit driving pins with PWM (in >> my case Servos) and with a bit of experimenting it looks like it might >> be these "pin1.write_analog(x_angle)" commands that are causing the >> lock-ups since by commenting out these "write_analog" commands (but with >> all the Radio commands still running) it hasn't locked up in over an >> hour. By comparison, with the "write_analog" commands still active, ~5 >> mins is the longest it runs without locking up. >> >> >> Maybe you could see if commenting out the "write_analog" commands on >> your setup has the same effects. It may not stop other errors but I'd be >> interested to see if it stops the lock-ups. >> >> >> >> Cheers, >> >> >> Nevil >> >> >> >> >> ------------------------------------------------------------------------ >> *From:* Microbit >> on behalf of David Booth via Microbit >> *Sent:* 23 December 2016 15:09 >> *To:* For Pythonic MicroBit related discussions >> *Cc:* David Booth >> *Subject:* Re: [Microbit-Python] List of error codes and their meanings >> >> Hi Damien >> >> I have a related question regarding run time errors in micro Python. >> >> I have three micro:bits. The first I call Rx because it basically >> receives x axis acceleration data in string form, via the radio from the >> other two micro:bits Tx1 and Tx2. Rx poles Tx1 then Tx2 with 100 ms >> gaps. Nicholas Tollervey showed me how to avoid the Type None error when >> converting the string to an integer in RX and I now have three simple >> script which enable Rx to drive pins P0 (from Tx1) and P8 (from Tx2) >> with a PWM signal. >> >> However after running perfectly well for anything from 10 seconds to a >> minute Rx freezes. On the very few occasions an error message has >> scrolled it appears to be saying that "received is not a string" and >> possibly there is a value error. However on 98% of occasions Rx is >> frozen to the extent it cannot report the error. Since spurious errors >> do not worry me, provided Rx continues with the polling loop, is it >> possible to suppress catching run time errors and if it is possible is >> it likely that the While loop would continue? >> >> Sometimes pressing reset restarts the system but sometimes I have to >> remove the battery. >> >> Thank you and a Happy Christmas >> David Booth >> ps will you be at BETT? >> >> >> On 20 December 2016 at 23:31, Damien George > > wrote: >> >> There are many exceptions and they can occur for many reasons. Almost >> all are based on CPython and the exceptions form a hierarchy. Eg, >> indexing a list with an out-of-bounds index will raise IndexError, >> which derives from LookupError, which derives from Exception, which >> derives from BaseException. >> >> For a list of implemented exceptions in MicroPython see >> https://github.com/bbcmicrobit/micropython/blob/master/ >> source/py/objexcept.c#L192-L280 >> > source/py/objexcept.c#L192-L280> >> >> On 21 December 2016 at 08:35, David Whale >> > >> wrote: >> > Is there anything in the docs that lists all the errors >> (exceptions) that >> > can occur in MicroPython and what they mean? >> > >> > The closest I found was this: >> > >> > >> https://github.com/bbcmicrobit/micropython/blob/a20fbe82c919 >> cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h >> > 9cea9519ce5a1140103f518b51caa/inc/py/qstrdefs.h> >> > >> > >> > Thanks >> > >> > David >> > >> > microbit.org-ticket: 460 >> > >> > >> > >> > _______________________________________________ >> > 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: