Import the library
The first thing in a block program is a red "from … import …" block under the yellow "set up". It tells Pybricks to use the SharpShot library.
Pick 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_cam_school.py (only this sensor) or MBC_sensors.py (the all-in-one library). You picked
MBC_cam_school.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.