Explore
Groups to get your gears turning
Attach your sensor to the underside of the lid with the laser pointing toward the opening. Place it within 20mm of the opening if possible - that way you won't need to modify the sample code.
If your build requires a different alignment, you can modify the code without too much trouble.