Example Code for UNIHIKER-Counting Display
Using a photo interrupter for counting and displaying the accumulated quantity on the UNIHIKER screen.
Hardware Preparation
- 1 x UNIHIKER
- 1 x photo interrupter
- 1 x Two-end PH2.0-3P White Silicone Twisted Wire
Software Preparation
- MindPlus
Wiring Diagram
Connect the photo interrupter to pin P24 on the UNIHIKER, as shown in the diagram below.

Other Preparation Work
Sample Code

Result
After the program runs successfully, when an object blocks the photo interrupter, the indicator light on the sensor will illuminate. When the object is removed, the count on the UNIHIKER will increment by 1.

Was this article helpful?
