Pages

Showing posts with label Coding. Show all posts
Showing posts with label Coding. 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.

Friday, 18 June 2021

Flow Charts And Dice

 LI: to learn how to use flow charts to plan coding.

Link to DLO



Friday, 4 June 2021

Being A Jedi in Coding

 LI: to code the to move backward without touching it - being a jedi.


In coding this week we were tasked to try make the mBot move backwards without touching it. My Robot will wait until I press the onbaord button before it does anything. While coding we are using these blocks to start the coding. To make the mBot we needed "If - Then - Else" block to give the mBot to choices of things to do. We used an ultrasonic sencsor which is on the front of it for it to sense if there was something 10cm away from the robot. If there is an object 10cm or less away from the robot the robot will move backwards. If there is an object further than 10cm away it will keep going forward. This is a pull into the forever block so that the robot constantly senses what is in front of it.

Friday, 21 February 2020

Tech Reflection




For tech this week were doing robotics and our teacher was called Mrs Ferguson. This week we did some coding, Our robots are called mBots and to do the coding we used mBlock. For the mBots we did Algorithms. The challenge is to make noise for the robots and lights.