We added a new episode about how to wire a $2 beam break sensor for use with the Modern Robotics DIM. You can use these to detect the presence of an item in a particular location (like a ball in your loader or shooter). The one we wired and tested seems to work pretty well.
It uses the same code as the other generic digital switches.
It does require two digital ports on the DIM. The first one needs three pins for the receiver (voltage, signal, ground) and the second one needs two pins for the transmitter (voltage, ground).
We didn't have to do anything special to get it to transmit on the second digital port. the pin seemed to be turned on already. If yours doesn't work automatically, you might need to turn on the pin, but I'm not 100% sure.
Youtube channel:
https://www.youtube.com/c/FTCTeam4962TheRockettes
Source code:
https://github.com/MSMHS-Robotics/FTC4962_Examples
Web site:
http://teamrocketrobotics.com/?page_id=66