Example Code for UNIHIKER-Graphical Programming Data Display
Connect the sensor to hardware P21 on the UNIHIKER, then display the data detected by the sensor on the UNIHIKER.
Hardware Preparation
- 1 x UNIHIKER
- 1 x Linear/Analog Hall Sensor
- 1 x Two-end PH2.0-3P White Silicone Twisted Wire
Software Preparation
Wiring Diagram

Sample Code

Result
When the S pole of the magnet faces the sensor detection area, the indicator light on the sensor illuminates, and the analog output value is greater than 2048. When the N pole of the magnet faces the sensor detection area, the indicator light on the sensor illuminates, and the analog output value is less than 2048. (When no magnetic pole is detected, the analog value is between 2030-2060.)
| Detected South Pole Magnet | Detected North Pole Magnet | |
|---|---|---|
| Effect Display | ![]() |
![]() |
Was this article helpful?


