Warning

This is the dev documentation for an unreleased version of MPF!

This is the documentation for MPF 0.56, which is the “dev” (next) release of MPF that is a work-in-progress. Unless you’re specifically looking for this version, you probably want to use the version of documentation called “latest” which is for the latest released version of MPF. That documentation is at docs.missionpinball.org/en/latest.

MMA8451-based accelerometers

Related Config File Sections
hardware:
accelerometers:

This chips can be connected to I2C and act a tilt and leveler. Available on adafruit (and elsewhere).

Configure using:

hardware:
  accelerometers: mma8451
accelerometers:
  my_accelerometer:
    level_x: 0
    level_y: 0
    level_z: 1
    number: 1-29
This example is tested to be valid MPF config. However, it is not integration tested.
hardware:
  accelerometers: mma8451
accelerometers:
  my_accelerometer:
    level_x: 0
    level_y: 0
    level_z: 1
    number: 1-29

This will configure an MMA8451 on I2C bus 1 with address 0x1D (29 decimal which is the default for this device). The exact numbering depends on your i2c platform.

../../_images/mma8451-i2c-usb-accelerometer.jpg

The device in the picture is using smbus on linux as i2c platform with an Atiny85-based I2C-USB adapter.

What if it did not work?

Have a look at our hardware troubleshooting guide.