Pages

Showing posts with label Microbit. Show all posts
Showing posts with label Microbit. Show all posts

Friday, 2 July 2021

Coding in Python

 LI: to learn how to code the micro bit in Python.




The first image shows the Python coding for flashing hearts. It flashes between a small heart icon and the regular. The main thing to notice between the python coding and the blocks is that the forever loop is at the top and the bottom of the content in both.

We then created a Python coding that uses buttons, the main thing to notice is the "def" which is defining what the on_button_pressed will make the microbit do. Again it has the top and bottom so the content can go inside it.

This task was fun because it actually felt like proffesional coding.



Friday, 25 June 2021

Coding - Tech - Rock Paper Scissors

 LI: to learn how to code the microbit to play rock paper scissors  and understand how a flowchart works.



This week for tech we were tasked to code our microbit to play rock paper scissors. The code for the microbit is in the DLO ubove. We then created a Flow chart on a google drawing to show how the game works.  To test if the LED worked we played a game together as a class. 
1.When I shake, it will chose a random number between1 to 3. 
2.I have to make a variable called and set this to the random nuber.
3.If the number is 1 - the microbit will show the symbol for Paper.
4.If the number is 2 - the microbit will show the symbol for Rock.
3.If the number is 3 - the microbit will show the symbol for Scissors.

I enjoyed this task because we got to learn what a flowchart is and how to code the microbit.