Skip to content

accelerometers:

This is a config file reference. Click for instructions.

This page is reference material which explains every setting and option for this section of an MPF yaml config file. See the instructions for config files for formatting and other details. See our guide to config file examples for more examples of real configs in action.

Valid in
machine config files YES ✅
mode config files NO 🚫

Hardware platforms which support accelerometers

The accelerometers: section of your config is where you configure accelerometers, including how many G forces trigger different events.

Like other hardware devices, you create a sub-entry for each accelerometer, then under there you configure additional settings. For example:

accelerometers:
  test_accelerometer:
    number: 1
    level_x: 0
    level_y: 0
    level_z: 1
    hit_limits:
      0.5: event_hit1
      1.5: event_hit2
    level_limits:
      2: event_level1
      5: event_level2

Required settings

The following sections are required in the accelerometers: section of your config:

number:

Single value, type: string. Defaults to empty.

Number of this device in your hardware platform. The actual meaning of this number depends on your hardware platform.

Optional settings

The following sections are optional in the accelerometers: section of your config. (If you don't include them, the default will be used).

alpha:

Single value, type: number (will be converted to floating point). Default: 0.8

The smoothing factor for single exponential smoothing (aka sliding window).

hit_limits:

One or more sub-entries. Each in the format of number (will be converted to floating point) : string

Events which are posted at a certain G-force/acceleration. You can specify multiple limits. You might use those to trigger tilt warnings.

level_limits:

One or more sub-entries. Each in the format of number (will be converted to floating point) : string

How much degree may the level be off? You can define multiple limits and which event should be posted when it exceeded.

level_x:

Single value, type: integer. Default: 0

level_x, level_y andlevel_z define the default axis which is considered as levelled. Defaults to (0, 0, 1) which means that the board is laying straight on the ground. If you mount it in the cab you want about 3 degree. Under the playfield you want 6-7 degree.

level_y:

Single value, type: integer. Default: 0

level_x, level_y andlevel_z define the default axis which is considered as levelled. Defaults to (0, 0, 1) which means that the board is laying straight on the ground. If you mount it in the cab you want about 3 degree. Under the playfield you want 6-7 degree.

level_z:

Single value, type: integer. Default: 1

level_x, level_y andlevel_z define the default axis which is considered as levelled. Defaults to (0, 0, 1) which means that the board is laying straight on the ground. If you mount it in the cab you want about 3 degree. Under the playfield you want 6-7 degree.

platform:

Single value, type: string. Defaults to empty.

Name of the platform this accelerometer is connected to. The default value of None means the default hardware platform will be used. You only need to change this if you have multiple different hardware platforms in use and this coil is not connected to the default platform.

See the Mixing-and-Matching hardware platforms guide for details.

platform_settings:

One or more sub-entries. Each in the format of string : string

The platform-specific hardware settings of this accelerometer.

console_log:

Single value, type: one of the following options: none, basic, full. Default: basic

Log level for the console log for this device.

debug:

Single value, type: boolean (true/false). Default: false

Set this to true to see additional debug output. This might impact the performance of MPF.

file_log:

Single value, type: one of the following options: none, basic, full. Default: basic

Log level for the file log for this device.

label:

Single value, type: string. Default: %

Name of this device in service mode.

tags:

List of one (or more) values, each is a type: string. Defaults to empty.

Help us write it!

This section is unwritten or needs an update or edit. Can you help write it? Get your name in lights and geeky pinball bragging rights! Hit the magic sparkly wand to the right of the title to see this page source on GitHub. Then add/edit and submit your change. It's easy!



Something missing or wrong? You can fix it!

This website is edited by people like you! Is something wrong or missing? Is something out of date, or can you explain it better?

Please help us! You can fix it yourself and be an official "open source" contributor!

It's easy! See our Beginner's guide to editing the docs.

Page navigation via the keyboard: < >

You can navigate this site via the keyboard. There are two modes:

General navigation, when search is not focused:

  • F , S , / : open search dialog
  • P , , : go to previous page
  • N , . : go to next page

While using the search function:

  • Down , Up : select next / previous result
  • Esc , Tab : close search
  • Enter : go to highlighted page in the results