Skip to content

Search the documentation

Kit
Firmware

LineSensor

Smart Car

Sees a dark line on a light floor. Each eye shines infrared light at the ground and measures how much bounces back: dark surfaces send back less.

The LineSensor class is reached through this attribute of robot.

Can be None.

All the attributes of robot are in its table. Read Attributes that can be None to see when a part is None.

Reads the eyes now: a list of 0/1, one per eye from left to right, or only eye index (0 is the leftmost).

read(index=None)

Used in examples: Sensor check, Line follower

True when the eyes read exactly pattern, a list such as [0, 0, 1, 0, 0].

matches(pattern) -> bool

Used in examples: Sensor check