Pages

Showing posts with label Technology. Show all posts
Showing posts with label Technology. Show all posts

Thursday, July 1, 2021

Coding in Python

 LI:To learn how to code the Microbit in Python


This first one shows the Python codingfor 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 bkocks 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" whcih is defining hat the on_button_presses will amke the microbit do.Again this ahs a top and bottom so the contest has to go inside it.

Something I found interesting about using coding in Python is being able to write the steps instead of using blocks.

Thursday, June 3, 2021

Being a Jedi in coding

 LI:To code the robot backwards without toching it - to be a Jedi




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 to do.We are using the ULTRASONIC SENSOR on the front of the robot and we need to sense if soemthing is 10cm in front of it.If soemthing is 10cm or LESS in front of the robot,Ut will move backwards.If soemthing is NOT less than 10cm in front of the robot,it will move forwards (Else). This is all put into a forever block so that the robot constantly senses what is in front of it.