Showing posts with label Coding. Show all posts
Showing posts with label Coding. Show all posts

Thursday, August 5, 2021

Coding with ptthon

LI:

To see and understand the connection between the written code, the block code and the flow chart.

This is the comparison between the Python coding, the blocks and the flowchart for making the Microbit act like a dice





Thursday, July 29, 2021

Flow Charts and Radio Chat

 Learning Intentions

To understand how flowcharts relate to coding blocks.

To understand how to get the microbit to talk to another microbit using radio signals.


Here is my flowchart practice document.

Link to DLO





The next activity today was coding the microbit to send a radio signal to another microbit. We had to make sure that both microbits were on the same group number so we didn't accidentally get a message from another group.






Thursday, July 1, 2021

Coding in python

 LI:To learn to code the microbot in python 




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



For this example for coding the buttons, the main thing to notice is the "def" which is defining what the on_button_pressed will make the microbit do. Again this has a top and bottom so the content has to go inside it.



Thursday, June 24, 2021

Rock Paper Sizzors

 LI:To learn how to code microbots to play rock paper sizzors and understond how to use a flow chart.


Link To DLO





  1. When I shake the microbit, it will choose a random number between 1 and 3
  2. I have to make a variable called hand and set this to the random number
  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 
  5. If the number is 3 - the microbit will show the symbol for scissors

Thursday, June 17, 2021

FlowchArt and Dice

 LI: To learn how to use flowcharts to plan coding.



Link Google Draw



Thursday, June 10, 2021

Building an mBot

 Learning Intention - To understand how the mBot is put together so that I can fix it when something goes wrong.

Today, we took an mBot apart and then reassembled it. We then tested it with some code to make sure that it worked correctly.

Here are the parts of the mBot that I took apart.



Here is the reassembled mBot



Here is the code that I used to test that it worked.

Thursday, June 3, 2021

Being a Jedi in Coding

LI: to code a robot to try and make it move forward and back withoutb touching it





My robot will wait until i have pressed the onboard button before it does anything. We used an "IF - THEN - ELSE" block as this gives the robot two choices of things to do. We are using the ULTRASONIC  SENSORon the of the robot and we need to sense if something 10cm in front of it. IF something is 10cm or LESS in front of the robot , it will move backwards. IF something is NOT less han 10cm in the front of the robot, it wil move forwards (ELSE). This is all put into a forever block so that the robot constantly senses what is in front of it