Friday 4 June 2021

Learning to be a Jedi with the robots

LI: To code the mbot to move backwards without touching it - to be a jedi


My robot will wait till 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 SENSOR on the front of the robot to sense if anything is in its way, the green block is the CM block and it helps the bot sense items/anything in its way. I made it 100 to test how far it would go but the class did 10.
IF something is 10cm or LESS in front of the robot, it will move forwards (ELSE).
If something is NOT less that 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.

No comments:

Post a Comment