bbcmicrobit / micropython

Port of MicroPython for the BBC micro:bit
https://microbit-micropython.readthedocs.io
Other
603 stars 283 forks source link

Reading out any Python errors for blind kids instead of (or as well as) scrolling them on the LEDs #467

Open dumbledad opened 7 years ago

dumbledad commented 7 years ago

I’ve been working recently on a tangible system for teaching visually impaired kids to code called Torino. One of the blind kids is ready to progress to a text based language.

His school mates are using Python on the micro:bit and so one of our collaborators has come up with a series of micro:bit Python lessons for him.

But he was stuck on the very first lesson:

from microbit import * import speech speech.say("hello")

He could write the program in Notepad++ using his JAWS screen reader. He could flash it to his micro:bit using the keyboard shortcut to uflash that we set up. He has the amp:bit to drive headphones or speakers. But no sound came out. Eventually his mum and I deciphered the scrolling text on the micro:bit, it said “error: unexpected indentation”. Without any of us noticing, his entire program was indented one tab stop. We removed the tabs and the program started working.

He is blind and so there is no way he could access that useful error message (in fact it was a struggle for his mum and I).

That got me thinking. It would be really useful for blind users if the micro:bit had the facility to read out its error messages instead of (or as well as) scrolling them. Is that a plausible patch to write? Any pointers on where I might start?

ntoll commented 7 years ago

@markshannon thoughts?

deshipu commented 7 years ago

I think the easiest and most flexible solution would be to use the screen reader on the REPL.

ntoll commented 7 years ago

@deshipu aha! That's a really great idea - I wish I'd thought of that. ;-)

@dumbledad connecting to the REPL is very easy and means your student can use native tools and a speech synthesiser that doesn't sound like a drunk dalek talking through a pillow case. :-) I'd be more than happy to help with making this happen (I might be in Cambridge next week visiting the Raspberry Pi Foundation if you're up for a coffee and a chat sometime, once I know the exact day?).

dumbledad commented 7 years ago

@ntoll Definitely - let's do that. Email me on timregan at microsoft dot com and we'll schedule

Does the screen reader on the REPL mean that we are moving him away from the micro:bit? If so I am a bit nervous about that as my goal is not just to help him learn how to code, but also the help him learn how to code with his school friends. They are using Python on the micro:bit.

dumbledad commented 7 years ago

@SaqibS & @armbennett may have thoughts too

armbennett commented 7 years ago

The REPL is great for live coding and experimentation, however when writing longer and more complex programs it can become limiting. It is very powerful for students to be able to flash a program to the micro:bit, unplug it and experience it running totally independently from the computer, especially when working with the accelerometer.

deshipu commented 7 years ago

REPL is not only useful for experimentation, it also displays the output of your programs and detailed information about the errors -- much better than what scrolls on the display. Of course you can unplug your microbit at any time once you finished debugging. Debugging using only the 5x5 screen is a really miserable experience, even if you can see.

dumbledad commented 7 years ago

@deshipu Does that mean we can write a Python micro:bit program and run it first in the REPL to monitor any error conditions and then, when it runs, flash it to the micro:bit?

ntoll commented 7 years ago

@armbennett completely agree with you about the REPL and working unplugged.

However, I also agree with @deshipu - during the development of a script you can print() things so they appear in the REPL. This is great for debugging. Also, all exceptions and errors are also reported on the REPL. Once your script is finished remove the print statements and work unplugged.

Does this make sense?

ntoll commented 7 years ago

@dumbledad pretty much yes... please see my immediately previous reply.

armbennett commented 7 years ago

@ntoll that makes sense. Can it be used without access to the command line as the laptop he is using is provided by the school he isn't allowed access to the command line which has caused problems in the past. Many other visually impaired children will be in a similar position.

ntoll commented 7 years ago

On Windows, assuming you have set up the Windows driver for USB serial, you should use putty.exe (http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) to connect to the board. Use Window’s Device Manager to discover the COM port to which the PyBoard is connected. Within the putty application, click Session in the left hand panel, click the Serial radio button, enter the COM port discovered via the Device Manager in the Serial Line box, and then click the “open” button.

Is this helpful?

armbennett commented 7 years ago

Yes that’s a good idea, thanks!

From: Nicholas Tollervey [mailto:notifications@github.com] Sent: 08 September 2017 14:04 To: bbcmicrobit/micropython micropython@noreply.github.com Cc: armbennett armbennett@mac.com; Mention mention@noreply.github.com Subject: Re: [bbcmicrobit/micropython] Reading out any Python errors for blind kids instead of (or as well as) scrolling them on the LEDs (#467)

On Windows, assuming you have set up the Windows driver for USB serial, you should use putty.exe (http://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html http://www.chiark.greenend.org.uk/%7Esgtatham/putty/latest.html ) to connect to the board. Use Window’s Device Manager to discover the COM port to which the PyBoard is connected. Within the putty application, click Session in the left hand panel, click the Serial radio button, enter the COM port discovered via the Device Manager in the Serial Line box, and then click the “open” button.

Is this helpful?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bbcmicrobit/micropython/issues/467#issuecomment-328097482 , or mute the thread https://github.com/notifications/unsubscribe-auth/AXT9Z0s6CqUpA43SAc6k45-06uoaCefDks5sgTsygaJpZM4PQ_5j . https://github.com/notifications/beacon/AXT9Z29meIfY0jJJ7dCINbhDWb_wDb6lks5sgTsygaJpZM4PQ_5j.gif

dumbledad commented 7 years ago

Interesting, and then we'd be see the REPL on the device over serial via PuTTY?

ntoll commented 7 years ago

Got it in one. :-)