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.

Leave a Reply

Your email address will not be published. Required fields are marked *