Warning

This is the documentation the latest work-in-progress version of MPF!

This is the documentation for MPF 0.57, which is the “dev” (next) release of MPF that is a work-in-progress. This is probably ok, and means you’ll be on the latest, cutting-edge version of MPF.

However, if you want a more stable version, select the v:stable version from the lower-left corner of this page. You can always update to the latest at any time.

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.