Pages

Friday 4 June 2021

Being A Jedi | Coding

 LI: to code the mBot to move backwards with the ultrasonic senser.



For our second tech session for coding we learnt to code our mBots to sense whats in front of it with a range of cm. In our coding program we used all of the codes above in the picture to create the actual code to initiate the ultrasonic senser. In the code we used "IF - THEN - ELSE" code whitch would allow the robot to process the code easily (e.g: IF mBot senses something THEN mBot will move backwards ELSE it will keep moving forward). Once the mBot has sensed that there is something in front of it, the mBot will move backwards due to the code we used with the ultrasonic senser. Moving our hand in sync with the Mbot will keep the mBot moving backwards until we take away our hand.

No comments:

Post a Comment