Example Code for UNIHIKER-Counting Display

Using a photo interrupter for counting and displaying the accumulated quantity on the UNIHIKER screen.

Hardware Preparation

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?

TOP