Pages

Showing posts with label microbit. Show all posts
Showing posts with label microbit. Show all posts

Friday, 2 July 2021

Coding in Python

 L.I to learn how to code the microbit in python


The first onr shows the python for flashing hearts. It flashes between the small herart icon and the large heart icon. THe main thing to ntice between the pythin coding and the blocks is the the forever loop is at the top nd bottom on the centent of both.


This is the example for coding hte buttons, the main thing to notice is that the "def" which is defining what hte on_button_pressed will make the microbit do.








Friday, 25 June 2021

Rock Paper Scissors

 L.I to learn how to code the microbit to play Rock Paper Scissors and understand how the flowchart matches the code.

Link to DLO

This week for tech we played rock paper scissors on the microbit. FIrst we had to code the microbit which is on the DLO. Once you have downloaded the code you have to shake the microbit and it will choose a random number bwetween 1 and 3. I have to make a variable called handand set this to the random number.
If the number is 1 the microbit the symbol for paper. If the number is 2 the microbit will the symbol for rock. If the number is 3 the microbit will show the symbol for scissors.