Tag: Tech

Tech | Coding – Blocks v Python

This week for tech, we learnt how to code the microbit. We first started by learning to use the blocks on the microbit site. The blocks we used were the forever block and the show leds block. The show leds block are used to make instructions that will show on the microbit. The forever block goes around the block to flash the heart and makes sure the instructions keep going.

Next, we attempted to do the same but using python. When doing the tutorial, you would need to copy the code at the top and it needs to be exactly the same as the code otherwise it might mess up the pictures that will flash on the microbit. The forever PYTHON is two lines of code that go around the other instructions at the top and bottom. Everything inside the PYTHON forever LOOP is INDENTED. Once we completed it, we used the blocks and picked pictures that will show on the microbit, and then we can check the code that makes the flashing picture.

 

I enjoyed this session because it gave me an opportunity to learn different ways to show a flashing hear and other pictures on the microbit site.

Tech | Coding

This week for tech, we were learning how to make mbots follow a black line. We need to be able to count to 3 in binary, 0=0, 0 1=0, 1 2 = 1,9 and 3 = 1,1. This is then used to tell the robot which way to go to follow the black line. If both sensors are on the black line, it is not getting any reflected light so it has an input of 0.0 – it has to move forwards. If the right sensor goes off onto the white – it’s input now 0.1=1 and it has to move a bit to the left. If the left sensor goes off onto the white – it’s input now 0.1=2 and it has to move a bit to the right. If both sensors are on the white – its input is now 1.1 = 3, so it has to move backwards till it finds the black line again.

I enjoyed doing this task because it gave me an opportunity to learn how to use binary code to help make an mbot follow a black line.