# Line Sensor

The line sensors return a value that represents the amount of reflected light read into the sensor. If the sensor is over the white line it will reflect more light to when it is over the black surface.

The line sensors are Analog sensors, that is the Controller will convert the sensor's analog voltage value into a digital number. The sumo board only has 4 ports that are capable of doing this: AC1, AC2, AC3 and AC5.

Experimentation is needed to work out the best value to use to detect the white lines.

```python
import time
import board
import analogio

AC1 = analogio.AnalogIn(board.AC1)

while True:
    #read the value of the sensor. White will be higher than black - experiment
    print("AC1:",AC1.value)
    time.sleep(0.1)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sumokit.buildingblockrobotics.com/sensors/line-sensor.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
