Jump to: navigation, search

SkeletonGame

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.