microbitmicropython.pdf
(
2148 KB
)
Pobierz
micro:bit MicroPython in 60 minutes
even if you’ve never programmed in Python before!
Romilly Cocking
This book is for sale at
http://leanpub.com/microbitmicropython
This version was published on 2017-03-16
This is a
Leanpub
book. Leanpub empowers authors and publishers with the
Lean Publishing process.
Lean Publishing
is the act of publishing an in-progress
ebook using lightweight tools and many iterations to get reader feedback, pivot
until you have the right book and build traction once you do.
This work is licensed under a
Creative Commons Attribution-ShareAlike 4.0
International License
Thanks to Ben Nuttall of the Raspberry Pi Foundation for creating the opportunity,
and to @sooseeg and @scipiguy for their encouragement and support.
Contents
Introduction
. . . . . . . . . . . . . . . . . . . . . . .
What you will do . . . . . . . . . . . . . . . . . . .
What you will need . . . . . . . . . . . . . . . . . .
You don’t have to finish everything in 60 minutes
Let’s get started with
mu!
. . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1
1
1
2
2
4
5
7
7
10
10
10
11
12
13
Plugging in your micro:bit
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Using mu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Hello World!
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Typing in a program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Images
. . . . . . . . . . . . . . . . . . .
Displaying a happy face . . . . . . .
Changing the display to a sad face .
Looping - repeating code . . . . . .
Making your own images . . . . . .
Animation - images that change . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Buttons
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
Moving and shaking
. . . . . . . . . . . . . . .
print() and the REPL . . . . . . . . . . . . . .
Repl
stands for
Read, Evaluate, Print Loop
Time to get coding! . . . . . . . . . . . . . . .
Time for some fun . . . . . . . . . . . . . . .
What’s next
. . . . . . . . . . . . . .
More stuff the micro:bit can do
Help, please . . . . . . . . . . . .
Where to find out more . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
16
16
17
18
18
21
21
21
21
Licence
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
23
Introduction
What you will do
In this 60 minute workshop you will use the
mu
editor on a Raspberry Pi to write
MicroPython programs and run them on the micro:bit.
MicroPython is a small but very fast version of Python 3 that has been specially
designed to work on microcontrollers such as those found on the micro:bit.
The experiments will show you some of the things the micro:bit can do. You can
use them as a base to build your own projects.
At the end of this workbook you will find some links to help you explore once the
workshop is over.
What you will need
You’ll need a BBC micro:bit and its USB connector. You don’t need a battery, as the
micro:bit will be powered via USB.
If you have a Raspberry Pi
This workbook assumes that you have a working Raspberry Pi with screen, key-
board and mouse, that you will connect via USB to a BBC micro:bit.
Plik z chomika:
xlo-30
Inne pliki z tego folderu:
microprocessor interfacing techniques.pdf
(109882 KB)
Beginning BBC micro bit.pdf
(25106 KB)
252630.pdf
(16622 KB)
networking_with_the_microbit.pdf
(12857 KB)
MicrobitLessonfull_withLessondividers.pdf
(22241 KB)
Inne foldery tego chomika:
Pliki dostępne do 01.06.2025
Pliki dostępne do 19.01.2025
#Aerobic
~bajki (b)
~OS_Commerce
Zgłoś jeśli
naruszono regulamin