The line-following widget is a clever, and useful set of components. It allows the user to read analogue values, which vary depending on how light/dark a colour it is over. This then enables you to create a line-following robot!

It is simple to set up. It needs a + and – output from the Crumble/battery pack and then the left(L) and right(R) pads need to be connected to any two I/O pads (A, B, C or D). You can then monitor the left and right analogue values of the pads from the software.
Note: Don’t forget you will need to add batteries.

The block that makes the magic happen.

This is one example of using the line follower digitally and this works best when it is less than 4mm away from the surface. If B is HI, then turn motor one, if C is HI turn motor 2.

Here is the line follower in action!