Import the library
The first thing in the program tells Pybricks "I want to use the SharpShot library". Without this line the hub does not know what MBC_CAM_SCHOOL means, and you get a NameError.
Pick one library (both work the same way; only the import line 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, and do not put it in a sub-folder.
- Go back to the main program and type the lines below at the very top (the lines marked ① on the right).