Example Code for Raspberry Pi-threshold interrupt function

Last revision 2026/01/21

Set up the threshold interrupt function for the BMM150 sensor on Raspberry Pi.

Hardware Preparation

Software Preparation

Wiring Diagram

Connect the module with Raspberry Pi as shown below. Default address: 0x13.

Connection Raspberry Pi

Other Preparation Work

  1. Enable Raspberry Pi I2C (follow steps in previous example).
  2. Install dependencies (follow steps in previous example).
  3. Download the library (follow steps in previous example).
  4. Navigate to the sample code directory:
    • cd DFRobot_BMM150/python/raspberrypi/examples/threshold_interrupt

Sample Code

Open the terminal and enter the following commands to run the sample code:

cd DFRobot_BMM150/python/raspberrypi/examples
cd threshold_interrupt
python threshold_interrupt.py

Result

Sample 4

Was this article helpful?

TOP