This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Demo Man config file for MPF 0.15.2 | |
Plugins: | |
- shots.ShotController | |
- keyboard.Keyboard | |
- ball_search.BallSearch | |
- logic_blocks.LogicBlocks | |
- scoring.ScoreController | |
- auditor.Auditor | |
- sound.SoundController |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Attract mode Scriptlet to fire coil | |
from mpf.system.scriptlet import Scriptlet | |
class PulseCoil(Scriptlet): | |
def on_load(self): | |
self.machine.events.add_handler('machineflow_Attract_start', self.start) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# switch_simulator.py | |
# By Brian Madden | |
# v0.1, March 19, 2014 | |
# Requires our "OSC" game mode, see here: | |
# http://www.pinballcontrollers.com/forum/index.php?topic=983 | |
import logging | |
logging.basicConfig(level=logging.INFO, filename="switch_simulator.log", format="%(asctime)s - %(name)s - %(message)s", datefmt="%H:%M:%S", filemode='w') | |
console = logging.StreamHandler() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# logplayer.py | |
# By Brian Madden | |
# v0.1, March 19, 2014 | |
# Plays back switch events from log files for the P-ROC pinball platform | |
# Requires file-based logging, see here for more info: | |
# http://www.pinballcontrollers.com/forum/index.php?topic=1130 | |
# Also require's our "OSC" game mode, see here: | |
# http://www.pinballcontrollers.com/forum/index.php?topic=983 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ratio = .7 # the ratio we'd like to convert to pwm. Must be between 0 and 1. | |
whole_num = 0 # tracks our whole number | |
output = 0 # our output 32-bit mask | |
count = 0 # our current count | |
for _i in range(32): | |
count += ratio | |
if int(count) > whole_num: | |
output = output | 1 |