Difference between revisions of "SkeletonGame"
(Created page with " == Skeleton Games HD Programming Reference. == This is meant to be a programming reference for commands, and simple snippets eventually. For setup and getting started with...") |
|||
Line 1: | Line 1: | ||
+ | == Programming Reference == | ||
− | + | This is meant to be a reference for commands, and simple snippets eventually. For setup and getting started with sample files start at the main SkeletonGame [http://skeletongame.com/ website]. | |
− | This is | + | === Machine Config YAML === |
+ | This is where you define your attached hardware sorted by board. | ||
− | ---- | + | ==== PD-16 (coil-driver board) ==== |
+ | Define coils or flashers on the PD board using the <code>Ax-By-z</code> format. | ||
+ | |||
+ | ''x'' is the '''Board ID''' (0-16) and must not conflict with any other ''PD-LED'' or ''PD-16'' | ||
+ | <br> | ||
+ | ''y'' is the '''Bank''' on board. So, '''Bank A''' is 0, '''Bank B''' is 1 | ||
+ | <br> | ||
+ | ''z'' is the '''Switch ID''' on the bank (0-7). Pin 1 is '''Switch ID 0''' | ||
− | + | Custom <code>tags</code> can also be used. See Advanced section. | |
− | |||
− | + | An example of coil configuration: | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | trough: | |
number: A0-B0-3 | number: A0-B0-3 | ||
pulseTime: 30 # the duration of the pulse, in ms. Default is 32ms | pulseTime: 30 # the duration of the pulse, in ms. Default is 32ms | ||
− | + | plunger: | |
number: A0-B0-4 | number: A0-B0-4 | ||
tags: autoPlunger | tags: autoPlunger | ||
Line 26: | Line 28: | ||
− | SW-16 (switch input board) | + | ==== SW-16 (switch input board) ==== |
− | Switches can be Optos or | + | |
− | + | Switches can be ''Optos'' or ''Standard''. Certain names are reserved for special cases, like | |
− | + | <code>trough1</code>. There must be numbers at end for each ball. Some examples of reserved names: | |
− | shooter | + | |
− | startbutton | + | troughJam |
− | tilt | + | shooter |
− | exit | + | startbutton |
− | down | + | tilt |
− | up | + | exit |
− | enter | + | down |
+ | up | ||
+ | enter | ||
+ | |||
+ | Switch example: | ||
− | + | PRSwitches: | |
− | PRSwitches: | + | # **** Format **** |
− | + | # name: | |
− | + | # number: <number> | |
− | + | # type: <type> | |
− | + | # | |
− | + | # <number> SW-16 board ID multiplied by 16 plus switch number. ID-0 bank-A Switch-0 is "0". The second bank adds 8 or range is switch 8-15 | |
− | + | # <type> can be: 'NO' (normally open. This is the default; so no need to use this) | |
− | + | # 'NC' (normally closed. Common for optos) | |
− | |||
flipperLwL: | flipperLwL: | ||
number: 8 | number: 8 | ||
Line 61: | Line 66: | ||
tags: anyswitch | tags: anyswitch | ||
− | PD-LED | + | |
− | LEDs can be single color or RGB | + | ==== PD-LED ==== |
+ | |||
+ | LEDs can be single color or RGB. | ||
+ | |||
+ | Example: | ||
+ | |||
################################################################# | ################################################################# | ||
# LED numbering format: Ax-Rr-Gg-Bb | # LED numbering format: Ax-Rr-Gg-Bb | ||
Line 79: | Line 89: | ||
polarity: False | polarity: False | ||
+ | == Coils == | ||
+ | Code examples for using coils. | ||
− | + | <code>self.game.coils.''coilname''.enable()</code>: Enable coil. Turn on full power, useful for lamps. '''Warning!''' this setting can fry coils. | |
− | + | <br> | |
− | + | <code>self.game.coils.''coilname''.disable()</code>: Disable coil. | |
− | + | <br> | |
− | + | <code>self.game.coils.''coilname''.pulse()</code>: Pulses coil with either default pulse or defined pulse in config YAML. | |
− | + | <br> | |
− | + | <code>self.game.coils.''coilname''.schedule(schedule=0x80808080, cycle_seconds=0, now=True)</code>: Activates coil driver on an ''on/off'' pattern an allows for custom patterns. Parameters include '''schedule''', an 8 digit pattern based on intensity (1-F), ''''cycle_seconds''' and '''now''' (True/False) - assume start time? | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Advanced == | == Advanced == |
Latest revision as of 18:45, 21 February 2020
Contents
Programming Reference
This is meant to be a reference for commands, and simple snippets eventually. For setup and getting started with sample files start at the main SkeletonGame website.
Machine Config YAML
This is where you define your attached hardware sorted by board.
PD-16 (coil-driver board)
Define coils or flashers on the PD board using the Ax-By-z
format.
x is the Board ID (0-16) and must not conflict with any other PD-LED or PD-16
y is the Bank on board. So, Bank A is 0, Bank B is 1
z is the Switch ID on the bank (0-7). Pin 1 is Switch ID 0
Custom tags
can also be used. See Advanced section.
An example of coil configuration:
trough: number: A0-B0-3 pulseTime: 30 # the duration of the pulse, in ms. Default is 32ms plunger: number: A0-B0-4 tags: autoPlunger pulseTime: 30 #pulsetime is optional
SW-16 (switch input board)
Switches can be Optos or Standard. Certain names are reserved for special cases, like
trough1
. There must be numbers at end for each ball. Some examples of reserved names:
troughJam shooter startbutton tilt exit down up enter
Switch example:
PRSwitches: # **** Format **** # name: # number: <number> # type: <type> # # <number> SW-16 board ID multiplied by 16 plus switch number. ID-0 bank-A Switch-0 is "0". The second bank adds 8 or range is switch 8-15 # <type> can be: 'NO' (normally open. This is the default; so no need to use this) # 'NC' (normally closed. Common for optos) flipperLwL: number: 8 ballsearch: stop throughJam: number: 37 #21 type: NC ballsearch: reset tags: troughJam,tilt_visible #advanced see yaml tags below StandUpRight: number: 41 #25 ballsearch: reset tags: anyswitch
PD-LED
LEDs can be single color or RGB.
Example:
################################################################# # LED numbering format: Ax-Rr-Gg-Bb # x = PD-LED board address # r = LED output number connected to the red input of an LED # g = LED output number connected to the green input of an LED # b = LED output number connected to the blue input of an LED ################################################################# bonus01: number: A3-R0-G1-B2 polarity: False tags: bonusMatrixLED label: '001 Bonus 1k' startButton: number: A3-R83 polarity: False
Coils
Code examples for using coils.
self.game.coils.coilname.enable()
: Enable coil. Turn on full power, useful for lamps. Warning! this setting can fry coils.
self.game.coils.coilname.disable()
: Disable coil.
self.game.coils.coilname.pulse()
: Pulses coil with either default pulse or defined pulse in config YAML.
self.game.coils.coilname.schedule(schedule=0x80808080, cycle_seconds=0, now=True)
: Activates coil driver on an on/off pattern an allows for custom patterns. Parameters include schedule, an 8 digit pattern based on intensity (1-F), 'cycle_seconds and now (True/False) - assume start time?
Advanced
Code snippets for common things every program will use, and advanced concepts that are easy to master.
Custom Switch tags: Yaml changes; Code changes; Init/ use.