UPM

The UPM API is a high level sensor library for IoT devices using MRAA. See examples here. Back to index page.
SparkFun sensor images provided under CC BY-NC-SA-3.0.

A110X Class

Module: a110x

UPM module for the A110X (A1101, A1102, A1103, A1104, and A1106) Hall Effect sensors. It outputs a digital signal indicating whether it is detecting a magnetic field with south polarity perpendicular to the sensor element.
a110x.jpg An example showing a simple test for the presence of a field An example demonstrating the use of an interrupt handler to count pulses

Methods

A110X

(
  • pin
)
Number

A110x digital sensor constructor

Parameters:

  • pin Number

    Digital pin to use

Returns:

Number:

magnetDetected

() Boolean

Determines whether a magnetic field of south polarity has been detected

Returns:

Boolean:

True if magnetic field detected

installISR

(
  • isr
  • arg
)

Installs an interrupt service routine (ISR) to be called when the appropriate magnetic field is detected

Parameters:

  • isr Function

    Pointer to a function to be called on interrupt

  • arg Void *

    Pointer to an object to be supplied as an argument to the ISR.

uninstallISR

()

Uninstalls the previously installed ISR