Difference between revisions of "Microbit Trainer Training"
From Wikicliki
(→Scoreboard) |
|||
Line 35: | Line 35: | ||
== Inputs == | == Inputs == | ||
+ | === Buttons === | ||
'''Step 1''' | '''Step 1''' | ||
Line 43: | Line 44: | ||
[[File:microbitexample_2.png|800px]] | [[File:microbitexample_2.png|800px]] | ||
+ | === Shaking and Tilting === | ||
'''Step 3''' | '''Step 3''' | ||
[[File:microbitexample_3.png|800px]] | [[File:microbitexample_3.png|800px]] | ||
+ | === Touching the pins === | ||
'''Step 4''' | '''Step 4''' | ||
Revision as of 03:05, 7 September 2018
Contents
Visual Programming with Micro:bit, Tinkercademy, 7 Sept 2018
- Slides: http://tinyurl.com/ntuc2018
- Use Google Chrome for this: https://makecode.microbit.org/
- This is called Block programming. You need to "snap" the part in (if audio is on, it will make a snap sound).
- You can also use the javascript if you want to code directly.
- Start with Forever block and plug in different blocks, such as Show Number, Show LED.
- Then try using the buttons..
- Keep the forever block
- Good practice is to load something into on start so that you know if it is working and not a hardware issue.
Let's use the LEDs! Default values, or manually plotting X & Y Axis
X Axis
Y Axis
Inputs
Buttons
Step 1
Step 2
Shaking and Tilting
Step 3
Touching the pins
Step 4
Step 5
Create variables
Simple Counter
Something is missing here. ask the class to figure out how to "show" the number.
Randomiser
Conditionals
Make a scissors paper stone. Make micro:bit choose scissors, paper, or stone when shaken.
- Hints: create one variable called "number"
- Pick a random number from 0-2 so we have 3 numbers (0, 1, 2)
- And use the If else statements
This works
Improving the logic statement
Click on the Gear icon to edit the conditional statement
Scoreboard
- Next, let's record the scores.
- When you press A, it should add 1 to the score.
- When you press B, it should minus 1 to the score.
- You must have a variable called "score"