Line follower example code in mblock5


#1

Hi
I’m new to Makeblock and I’m trying to program the line following sensor on my mBot. The problem is I don’t find example code in mblock5, only in mblock3. Can someone share a good tutorial or link with some example code? Me and my 11 years old daughter would be very grateful!
Thanks,
Patrick


#2

Hi,

Since mBlock 5 doesn’t appear to let you use the sprites to display values, you could start with the following program. The values for the variables should be displayed in the stage area, but I also used the LEDs to indicated state. Making this a standalone would only require that you replace the When Clicked hat block as we had discussed in a previous thread. The movement logic would be similar to what you’d do in mBlock 3, i.e., when one of the two sensors is off of the line, make a small turn in the opposite direction.


#3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.