Key Functions

Overview

The behaviour and information processing is distributed across multiple regions in the controller.

Actuating

The actuation of flippers is implemented via a common automaton to which the appropriate signals are connected. The connected output signals are what is used to set the values of the GPIO pins by the outside system. With the trigger  signal a standard actuation of the flipper can be initiated. The automaton waits after enabling and disabling for the real world to catch up, as the flipper arms take some time to move from their resting position and back. Additionally there is a hold signal which can be used from the outside to basically override the behaviour regarding the cooldown.

TriggerDelayed

As previously mentioned these regions are simply an extension on top of the Actuating  regions. They receive a trigger signal and then wait for a certain amount of time until passing that information onwards (ie. setting the trigger signal connected to one of the Actuating regions seen above.

Prediction

TODO

Launching

This first region determines when the launch lamp is blinking (ie. a ball is ready to launch) and when to launch. When the lamp turns on and the automaton has not received a new ball position from the outside system we assume it is starting to blink. We keep track of the state of the lamp and if for example it only turned on once a cooldown timer will run out and we determine it is not continuously blinking like it does when we are able to launch a ball into the game. If the automaton determines the lamp to be blinking for a long enough time (the 20 million points bonus timing), then a signal is set which is consumed by the following region.

Here we simply set signals that actuate both flippers for a time period so that the pinball machine launches the ball. If this time is too short both flippers will still actuate, but the pinball machine won't launch the ball.