Symbols
[]
(brackets), displaying, 62
<> brackets, yotta command line, 85
Numbers
3V header pin, 94
16 KB of RAM, 22
32-bit machine, 21
A
“A” and “B” patterns, 11
A button, counting presses, 13
accelerometer
described, 19
features, 54
movement and axes, 54
REPL function, 57
X-, Y-, and Z-axes, 54
analog effects, producing, 98–99
apps. See third-party apps
Arduino IDE, 38
ARM Cortex processor, 4
arm-none-eabi-gcc compiler, 84
arrows, 67
B
banana plugs, 92
BBC (British Broadcasting Corporation), Make It Digital Initiative, 4
BBC micro:bit
features, 4
BLE (Bluetooth Low-Energy)
specification, 110
BLE.cpp
file, creating, 114
Blocks Editor
categories and functions, 155
completed program, 157
environment, 6
Radio pieces, 155
scripts, 154
while()
loop, 156
Bluetooth. See also UART and Bluetooth
client attributes and services, 119–120
cloning HelloWorld.cpp
, 114
compiler, 113
connecting to micro:bit, 118
detecting button presses, 121
“Draw a circle” message, 117
GATT_TABLE
, 117
importing programs, 114
initializing on micro:bit, 115
mbed operating system, 113
micro:bit program, 113
MicroBitConfig.h
file, 116
naming board, 120
pairing experiments, 111
pairing micro:bit to phone, 117–118
pairing process, 119
processor, 20
reading from thermometer, 122
services, 117
using C++, 111
versus WiFi, 110
writing to display, 122
Bluetooth Smart protocol, 22
boards
flashing, 17
procuring, 7
resetting, 17
Boolean conditional, 55
bot platform. See micro:bot
brackets ([]
), displaying, 62
brightness, LEDs, 98
BTN_* header pins, 94
C
calibrate()
function, compass, 57–58
cell phone, growth, 3
“CHASE THE DOT” message, 11
Check button, 46
check mark, displaying, 56–57, 65
Claessens, Jo, 145
classes, learning about, 74
clock displays, mu IDE, 48
Code Kingdoms
Add Event button, 161
Basic category, 161
clearing screen, 161
code, 163
Compile button, 1644
control flow blocks, 162
deleting blocks, 163
features, 158
libraries, 159
main program script, 162
onStart()
function, 161
patterns, 161
previewing program, 163
while()
loop, 162
workspace, 159
code-completion feature, 33–34
coding environments, 29
COL* header pins, 94
compass
Image.HAPPY
, 58
magnitude of magnetic fields, 60
compass/magnetometer, features, 57
CPUs, processing tasks, 27
D
default program, 11–12. See also programming micro:bit
devices, flashing, 13
dialout
group, mu IDE, 36
diamond shape, displaying, 56–57
DigitalOut
document, 75
DIO header pin, 94
display()
method, 46
display.show()
method, mu IDE, 47
E
edge connector breakout board, 7–8, 26. See also GPIO (general-purpose input/output) pins
GND post, 97
GPIO header pin descriptions, 94
multimeter reading, 96
potentiometer’s value, 100
prototyping area, 95
Edge Connector Motor Driver Board, 8–9
errors. See Check button
Evothings environment, 123–124
F
Finder window (Mac), 12
flash memory, 21. See also memory
flashing boards, 17
flashing devices, 13
functions, availability, 65–66
G
GATT_TABLE
, Bluetooth, 117, 131
gcc compiler, installing, 81
get_presses()
method, mu IDE, 53
G-force gestures, accelerometer, 54
GND post, edge connector breakout board, 97
GPIO (general-purpose input/output) pins. See also edge connector breakout board
banana plugs, 92
GPIO header pin descriptions, 94
“GREAT! NOW GET CODING!” message, 11
Groups
folder, 74
H
.h extension, 74
Hall, Tony, 151
header pins, 94
“Hello, World!” programs
MicroPython, 31
Microsoft Touch Develop, 168
mu IDE, 41
HelloWorld.cpp
, cloning for Bluetooth, 114
help()
command, Python programming language, 74
hex files, opening, 13
homebrew package management, 83–84
I
I2C (Inter-Integrated Circuit) protocol, 20, 100–103
IC (integrated circuit), 18, 20
IDEs (integrated development environments), 29, 33
Image.ARROW
, 67
Image.CLOCK2
, mu IDE, 48
Image.HAPPY
, 58
import
statements, Python, 74
importing libraries, 64
indenting lines, mu IDE, 62
Intel Edison, 4
IoT (Internet of Things), 2–3, 69
J
JavaScript, 153
Jodrell Bank Observatory, 149
K
L
LEDs. See also status LED
brightness, 98
flashing, 11
patterns, 12
libraries, importing, 64
lines, indenting, 62
Linux
man
pages, 74
loops
breaking from, 62
craps game, 66
M
macOS
yotta customization, 82
yotta window, 79
magnetic fields, magnitude, 60
Make It Digital initiative, 4
Make It Digital season, 150–151
mbed operating system. See also yotta command-line
blinky program, 76
Bluetooth, 113
code examples, 72
device selection, 72
microbit-hello-world
program, 72–73
memory, 60–61. Seealso flash memory
micro:bit
connecting to USB port, 10
dimensions, 15
edge connector breakout board, 26
future, 150
input voltage, 15
obtaining, 7
programming, 6
USB micro port, 15
micro:bit app, 112
MICROBIT device, dragging scripts to, 13
Micro:bit Education Foundation, 145, 150
Micro:bit Foundation, 6
microbit
libraries, yotta command-line, 86
microbit
module, sleep
method, 43
MicroBit object, initializing, 130
microbit-astounding-script.hex
file, 13
MicroBitConfig.h
file, Bluetooth, 116
microbit-dal
MicroBit.Image
object, mu IDE, 50
microbit-samples
code, cloning, 126
micro:bot
completing, 135
SPST (single-pole-single-throw) switch, 134
Turtle platform, 134
MicroPython environment
filling in code, 32
Help button, 32
My Scripts icon, 31
screen shot, 7
scripting page, 30
USB cable, 31
Zoom buttons, 33
Microsoft Block Editor environment, 6
Microsoft Touch Develop
events and functions, 167
features, 64
functions, 166
Hello, world! 168
interacting with code, 164–165
interface, 165
led
, 166
libraries, 67
paste, copy, cut, 166
script, 168
suggestions, 165
MI:power board, micro:bit, 9–10
MISO header pin, 94
Molex female connector, 18
MOSI header pin, 94
motor driver board
button pins, 106
input terminal blocks, 107
jumper wires, 104
motor terminals, 105
pin values and motor directions, 106
power supply, 104
using, 104
mu IDE
application, 35
Arduino IDE, 38
arrows, 67
breaking from loops, 62
Check icon, 43
clock displays, 48
dialout
group, 36
display()
method, 46
displaying heart, 41
display.show()
method, 47
downloading and installing, 34–35
editor, 37
Files and REPL (Read-Eval-Print Loop), 39
Flash, Files, and REPL (Read-Eval-Print Loop), 38, 42
get_*()
commands for compass, 60
get_presses()
method, 53
“Hello, World!,” 41
help()
command, 40
Help icon, 37
Image.CLOCK2
, 48
importing libraries, 64
indenting lines, 62
light versus dark environments, 37
line.hex
file, 43
Linux box, 36
“live-programming” feature, 39
microbit
module, 43
MicroBit.Image
object, 50
New, Load, Save icons, 37
newline, 43
open()
function, 62
os.listdir()
function, 62
Quit icon, 37
random.seed()
, 64
scroll()
method, 47
show()
function, 46
show_roll()
function, 65
starting, 36
string assignment, 67
Theme icons, 37
uploading code, 38
while
loop, 43
window panes, 40
Zoom icons, 37
N
NetBeans local compiler, yotta command line, 87–89
newline, mu IDE, 43
NIC (network interface card), 27
nRF Connect for Mobile, Bluetooth, 111
NVIDIA Jetson TK1, 1
O
O’Brien, Tim, 149
open()
function, mu IDE, 62
os.listdir()
function, mu IDE, 62
OV header pin, 94
P
PAD* header pins, 94
Pi Foundation, 149
Pi Zero, 1
pins. See GPIO (general-purpose input/output) pins; header pins
pixel animation, 52
processors, ARM Cortex, 4
program logic, establishing, 74
programming environments
Microsoft Touch Develop, 164–169
programming languages, 29
programming micro:bit, 6. See also default program
programs, adding, 13
PWM (pulse width modulation), 98–99
Python programming language, 29–30
Boolean conditional, 55
functions, 32
help()
command, 74
import
statements, 74
tuple, 54
R
RAM, 22
random.seed()
, mu IDE, 64
read_analog()
, edge connector breakout board, 96–101
REPL function
accelerometer, 57
mu IDE, 74
reset button, 17
RISC (Reduced Instruction Set Computer), 27
rolling dice, simulating, 64–65
S
SBCs (single-board computers), 1, 26
SCK header pin, 94
scripts, writing, 13
scroll()
method, mu IDE, 47
see text
comments, craps game, 66
“SHAKE” message, 11
show()
function, mu IDE, 46
show_roll()
function, mu IDE, 65
sleep
method, microbit
module, 43
SoftBank, 28
Sparks, Michael, 145
SPST (single-pole-single-throw) switch, micro:bot, 134
status LED, 17. See also LEDs
strings, assigning, 67
Structs
folder, 74
T
text editors, 13
Touch Develop. See Microsoft Touch Develop
tuple, Python programming language, 54
Turtle platform, 134
U
UART and Bluetooth. See also Bluetooth
disabling whitelist, 132
GATT table, 131
hex file, 132
Import Into Computer, 127
Import Library, 127
MicroBitConfig.h
file, 131
microbit-dal
folder, 126
microbit-samples
code, 126
onConnected()
function, 130
onConnected()
function, 130
smartphone app, 132
turning off services, 131
Ubuntu. See Linux
USB microcontroller, 18
USB port
connecting to, 10
locating, 15
MicroPython environment, 31
W
websites
Bluetooth, 110
Evothings Studio program, 123
mbed operating system, 70
NetBeans local compiler, 87–88
while
loop, mu IDE, 43
while not
loops, mu IDE, 66–67
WiFi, versus Bluetooth, 110
Windows
yotta interface, 78
Windows Explorer window, 12
write_analog()
, edge connector breakout board, 95–96
write_digital()
, edge connector breakout board, 95–96
Y
YES
symbol, displaying, 65
yotta command line. See also mbed operating system
<> brackets, 85
/bin
subdirectory, 81
default answers, 85
features, 77
Hello, world application, 85–87
main.cpp
program, 87
microbit
libraries, 86
18.118.31.24