mb4ps_Lesson6_PXT - microbit for primary schools

Session 6 – PXT Editor update
Pressing the pins
Written by Neil Rickus. Licensed under CC BY-NC-SA 4.0
 Complete a circuit using the pins
 Create random numbers
 Use selection (if, then, else)
 We can create a circuit by touching 0 (P0 in the PXT Editor) and
ground (GND)
 Try making something happen when pin P0 is pressed
 You might display some text or random numbers
 We can use random numbers to display different messages to
the screen by combining them with selection (if, then, else)
 This program will make
a friendship detector

Click on the cog icon
to get the else if block
 Make a message scroll before your friend tester results are
displayed
 Make pin 2 test for something else (e.g. how hungry you are; what
video game you should play; where you should go next on holiday)