Import the library
The first thing in a block program is a red "from … import …" block under the yellow "set up" block. It tells Pybricks to use the Pathfinder 16-Way library.
Choose one library (the blocks are exactly the same; only the name after from is different):
- Download the library (save the file and keep its name): MBC_line16.py (only this sensor) or MBC_sensors.py (the all-in-one library). You picked
MBC_line16.py. - In Pybricks Code, press "Import a file" in the file panel on the left and import it into the same project. Do not rename the file.
- Press "+" to add a new file and choose blocks.
- From the block list, drag out the red "from … import …" block, attach it under "set up", and pick the two names.