diff --git a/FlippR-Driver/contrib/json_example/README.md b/FlippR-Driver/contrib/json_example/README.md new file mode 100644 index 0000000..0a74099 --- /dev/null +++ b/FlippR-Driver/contrib/json_example/README.md @@ -0,0 +1,164 @@ +# JSON +This is an example for the JSON files passed to the Server for configuration + +All outputs may use port_externders in the form of: + +``` + "port_extenders" : + [ + { + "name" : "extender_1", + "i2c_address" : 32, + "pin_base" : 65 + } + ] +``` + +To use them the output pins bust have an additional property `"extender"` where the name of the extender were the address belongs to is specified. + +## server_config.json +This is a Collector file in which all other json files might be specified + +``` +{ + "input-config": Path, + "matrix-config": Path, + "lamp-config": Path, + "solenoid-config": Path, + "sound-config": Path, + "display-config": Path +} + +``` +## input/Input_Pin_Config.json +Contains the hardware configuration of the inputs. + +``` +{ + "update_frequency": number, // How often the inputs should be read in Hz + "row": { // The input pins of the rows + "A": number, + "B": number, + "C": number + }, + "col": { // The input pins of the cols + "A": number, + "B": number, + "C": number + }, + "data": number // The data pin to read +} +``` +## input/Input_Matrix_Config.json +This contains all possible events that might happen on the pinball machine. + +``` +{ + "global_bounce_time" : number, // How long to wait between input events + "input_matrix": // The actual matrix + [ + { + "name" : string, // Name of the event that should be fired + "address" : number, // Adress of the event + "priority" : number, // Priority of the event. In case multiple events get read this fires first. + "bounce_time": number // Individual bounce time. Overwrites globale_bounce_time for this event. + }, + ] +} +``` + +## output/Display_Config.json + +This contains the config for the displays. + +``` + { + "update_frequency": number, // How often the displays should be updated in Hz. + "display_board": // The pin configuration of the hardware + { + "segment_select" : // pins for the segment select + { + "A" : number, + "B" : number, + "C" : number + }, + "digit_select" : // pins for the digit select + { + "A": number, + "B": number, + "C": number, + "D": number + }, + "run" : number, // Run pin + "lt" : number // lt pin + }, + "displays" : // The actual displays + [ + { + "digits" : number, // how many digits the displays have. Possible values are 8 and 7 + "name" : string, // Human Readable name + "address" : number // Address of the display + }, + ] +} +``` + +## output/Lamp_Config.json +Contains the configuration of the lamps. + +Similar hardware configuration to above. Except a port extender may be used here. + +``` +{ +... + "lamps" : + [ + { + "address" : number, // address of the lamp + "name" : string // Humand readable name + } + ] +} +``` + +## output/Solenoid_Config.json + +Contains the configuration for the solenoids + +``` +{ + "deactivation_time_milliseconds" : number, // Time how long the solenoid should be triggerd + "flippers" : // addresses and names of the flippers + [ + { + "address" : number, + "name" : string + }, + ], + "solenoids" : + [ + { + "address" : number, // Address of the solenoid + "name" : string, // Human readable name + "deactivation_time_milliseconds" : number // Individual deactivation time for this solenoid + }, + ] +} +``` + +## output/Sound_Config.json +Contains the configuration for the sounds. + +Please note that address 0 is the deactivation sound for this flippers. + +``` +"sounds" : + [ + { + "id": number, // Id of the sound + "address" : number, // Address of the sound + "name" : string, // Human readable string + }, + ] +} +```