diff --git a/FlippR-Driver/contrib/Input_Matrix_Config.json b/FlippR-Driver/contrib/Input_Matrix_Config.json index ad0f692..585cecf 100644 --- a/FlippR-Driver/contrib/Input_Matrix_Config.json +++ b/FlippR-Driver/contrib/Input_Matrix_Config.json @@ -4,187 +4,224 @@ { "name" : "Out hole", "address" : 16, - "priority" : 1 + "priority" : 1, + "deactivation_time" : 50 }, { "name" : "Left outer exit canal", "address" : 17, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "Inner left canal", "address" : 18, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "Left flap contacts", "address" : 19, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "Right flap contacts", "address" : 20, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "Right inner canal", "address" : 21, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "Right central exit canal", "address" : 22, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "Right kicker contact", "address" : 23, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "Contacts", "address" : 24, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "1st moving target bottom left bank", "address" : 25, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "2nd moving target bottom left bank", "address" : 26, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "3rd moving target bottom left bank", "address" : 27, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "4th moving target bottom left bank", "address" : 28, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "Fixed special red target", "address" : 29, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "Fixed special orange target", "address" : 30, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "1st moving target bottom right bank", "address" : 31, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "2nd moving target bottom right bank", "address" : 32, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "3rd moving target bottom right bank", "address" : 33, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "Spinning target", "address" : 34, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "1st button", "address" : 35, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "2nd button", "address" : 36, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "3rd button", "address" : 37, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "4th button", "address" : 38, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "5th button", "address" : 39, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "1st moving target top central bank", "address" : 40, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "2nd moving target top central bank", "address" : 41, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "3rd moving target top central bank", "address" : 42, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "4th moving target top central bank", "address" : 43, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "5th moving target top central bank", "address" : 44, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "1st fixed target", "address" : 45, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "2nd fixed target", "address" : 46, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "Top left pop contact", "address" : 47, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "Bottom right pop contact", "address" : 48, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "5th fixed target", "address" : 49, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "4th fixed target", "address" : 50, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "3rd fixed target", "address" : 51, "priority" : 2 + "deactivation_time" : 50 }, { "name" : "Rising ball contact", "address" : 52, "priority" : 2 + "deactivation_time" : 50 } ] } \ No newline at end of file diff --git a/FlippR-Driver/src/input/Detector.cpp b/FlippR-Driver/src/input/Detector.cpp index 210de01..68d8c81 100644 --- a/FlippR-Driver/src/input/Detector.cpp +++ b/FlippR-Driver/src/input/Detector.cpp @@ -58,6 +58,7 @@ void Detector::detect() std::vector Detector::check_inputs() { std::vector detected_addresses; + for(char pin = 0; pin < (INPUT_MATRIX_SIZE * INPUT_MATRIX_SIZE); pin++) { if(input_gpio_interface->read_data(pin)) @@ -66,6 +67,7 @@ std::vector Detector::check_inputs() detected_addresses.push_back(pin); } } + return detected_addresses; }