Post on 20-Jan-2016
transcript
The BBC micro:bitand
Microsoft Touch DevelopTom Ball, Peli de Halleux, Michał Moskal, Jonathan Protzenko
Microsoft Research
http://www.microbit.co.uk/
http://www.touchdevelop.com/
GloballyEmerging recognition that K-12 Computer Science is• Educationally
foundational,like science, mathematics
• Economically crucial,and not just for geeks
USA, Malaysia, Korea, Japan, Sweden, Canada, Germany, Hungary, Israel, Holland, Denmark, Estonia, New Zealand... it's going to happen!
England
• Every child will learn computer science from primary (age 6) onwards
• A crucial laboratory
The UK journey
Vision
Positioning
• Educational not instrumental:Not just a vocational/economic imperative
• Ideas, not technologyNot even primarily about computers!
• Discipline, not skillIn particular, not just coding!
Computer science is a foundational
subject discipline,like maths and natural
sciencethat every child should
learnfrom primary school
onwards
The UK journey
Depth engagement
• Vibrant grass roots movement: teachers, professionals, academics.
• Community of practice, to support, encourage, equip, give vision to innovative computing teachers
• Independent: speaks for the subject, not for teachers, or academics, or companies, or govt.
• The Big Society: works with dozens of other groups of enthusiasts: Raspberry Pi, Code Club, Codecademy, code.org, cs4fn, Apps for Good, Sonic Pi, etc
MSR launchesComputing at
School(2007)
20,000 members
Growing at 500/month
About 3/4 teachers
Both primary and secondary
A community A gift economy
UK-centric,but open to international members
163 CAS Hubs In-person meetings of classroom teachers, university academics, software professionals
Small, informal, welcoming, supportive
Started Sept 2014
in England
The UK journey
Engagement at scale
• An entirely new subject at school• 3,500 secondary schools
17,000 primary schools200,000+ teachers
• Virtually no qualified teachers
• Teachers hungry for support
• Government explicitly standing back, inviting others to lead
Challenge
• Vision: repeat the "BBC Micro" impact. From the classroom to the kitchen table
• A year-long campaign across all of BBC broadcasting
• A million devices, one for each 12-year old
What is the BBC micro:bit?
• a small personal coding device
• an exciting intro to coding and making for students
• an IoT “starter” kit
What makes the BBC micro:bit unique?• Small and attractive
• low geek factor• appeals across ages, genders
• Inexpensive and simple to produce/embed• wiring micro:bit to sensors, other micro:bits, …• an affordable embedded controller
• Connectivity via I/O pins and Bluetooth LE• BLE to smartphones, tablets, PCs• and through these hubs, the cloud
Goals for the BBC micro:bit
• a browser-based programming experience
• a choice of languages and programming experiences
• an layered architecture that supports progression
• content to support teachers in the classroom
Demowww.microbit.co.uk
Goals for the BBC micro:bit
• a browser-based no-install experience
• a choice of languages, programming experiences, platforms
• an layered architecture that supports progression
• content to support teachers in the classroom
The technology stack
• www.touchdevelop.com• edit/run/simulate/compile
• C++ micro:bit runtime
• mbed platform, SDK
OS
HDW
PL
a cloud of scripts, users
a browser-based IDE, for mobile devices
a statically-typed language and libraries
www.github.com/Microsoft/TouchDevelop
Touch Develop is…
1 2
3 4
Choice
Choice
Block Editor Touch Develop• Drag and drop• No syntax errors• All variables are global• No types
• Cursor-based editing• Few syntax errors• Global and local variables• Static types
Some of the micro:bit APIs
• Basic• show number• show string• show animation
• LED• direct manipulation of display
(plot, unplot, point)
• Image• creation of “sprites” and “sprite
sheets”
• Input• event-based and polling• buttons, accelerometer, compass
• Pins• analog/digital read/write• pitch
• Game• simple game
• Events• for BLE
Touch Develop script
C++ micro:bit runtime
ARM binary
Compile
ARM
mbed C++ SDK
C++
1
User copies ARM binary
to micro:bit drive
3
User edits script and compiles
Drive
Web browser
2
USB
User accepts “download” of ARM binary
CompileTouch Develop
ARM
ARM runtime (precompiled)
ARM machine code
CompileTouchDevelop
Block Editor
Block Editor script1
KoduAGE PROGRESSION
Tile-Based Programmi
ng
Block-Based
Programming
Simplified
Language
Simplified Lang. &
IDE
Full Language
& IDE
Kodu / Spark Touch Develop Small Basic Visual Studio
Programming progression
micro:bit
The technology stack
• www.touchdevelop.com• edit/run/simulate/compile
• C++ micro:bit runtime
• mbed platform, SDK
OS
HDW
PL
ARM’s mbed platform
• mbed-compatible board appears as mounted drive when connected via USB• Copy hex file to drive to flash it
• choice of Windows, MacOs, ChromeBooks, Linux
• no installation needed
• http://developer.mbed.org/• Free, web-based development environment• Compile C++ to hex file using armcc or gcc
• mbed SDK is open source under Apache 2.0• https://developer.mbed.org/users/mbed_official/code/mbed-src/ • https://developer.mbed.org/handbook/mbed-library-internals
TouchDevelop script
C++ program
ARM binary program
Compiler1
TouchDevelop
C++
ARM binary
Compiler2
mbed compile service
ARM
mbed C++ SDK
C++
1
User copies ARM binaryto micro:bit drive
3
User codes TouchDevelopscript and presses “compile” button
Drive
Web browser
2
USB
User accepts download of ARM binary
BB micro:bit – the C++ runtime
• Provides a Device Abstraction Layer (OS) for micro:bit• hardware components• simple message bus and events • co-routines (fibers) and non-preemptive scheduler• display driver• high-level helper functions (scroll string)• a few managed types (reference counted)
• To be open sourced (currently private) at • https://github.com/lancaster-university/microbit-dal
The technology stack
• www.touchdevelop.com• edit/run/simulate/compile
• C++ micro:bit runtime
• mbed platform, SDK
OS
HDW
PL
Control and Coordination
• MicroBit• represents the micro:bit device as a whole and its
various components
• MicroBitComponent• abstract representation of a hardware component• the functions needed to drive/poll that hardware
• MicroBitEvent• an event generated by some
MicroBitComponent
• MicroBitMessageBus• delivers asynchronous MicroBitEvents via a
send/listen pattern
• Fiber• a lightweight representation of a cooperative
thread of execution (i.e., a co-routine)
MicroBitDisplayrepresents the LED matrix array of the device
MicroBitButtonrepresents a single, generic button
MicroBitMultiButtonrepresents a virtual button
MicroBitCompassrepresents an implementation of the Freescale MAG3110 I2C Magnetometer
More Classes
• MicroBitSerial• a subclass of mbed’s Serial that accepts micro:bit specific data types
• MicroBitIO• a representation of all given I/O pins on the edge connector
• MicroBitI2C• indirect access to mbed I2C
• MicroBitEventService• provides a BLE gateway for sending MicroBitEvents to the MicroBitMessageBus
• MicroBitDFUService represents a Device Firmware Update (DFU) loader that • provides a simple mechanism to identify an individual micro:bit amongst a classroom of others• allows BLE devices to discover and cache a passcode that can be used to flash the device over
BLE • provides a BLE escape route for programs that 'brick' the micro:bit
BBC micro:bit content
• Quick Start Guide for Teachers• Distributed to 20,000+ teachers
• 40+ online lessons• Lesson = Activity + Quiz + Challenges• Mapped to UK CS curriculum• Printable
Questions?