1313
1414
1515def process_left_slider_buttons ():
16+ """
17+ Retrieve the left slider button values from the etee driver.
18+
19+ :return: Array containing the left controller's slider button values: up and down button states.
20+ :rtype: list[bool]
21+ """
1622 left_slider = [etee .get_slider_up_button ('left' ), etee .get_slider_down_button ('left' )]
1723 return left_slider
1824
1925
2026def process_right_slider_buttons ():
27+ """
28+ Retrieve the right slider button values from the etee driver.
29+
30+ :return: Array containing the right controller's slider button values: up and down button states.
31+ :rtype: list[bool]
32+ """
2133 right_slider = [etee .get_slider_up_button ('right' ), etee .get_slider_down_button ('right' )]
2234 return right_slider
2335
2436
2537def print_title ():
38+ """
39+ Print CLI graphics for the application title.
40+ """
2641 print ("======================================================" )
2742 print (r" __ ___ ____ ____" )
2843 print (r" ___ / /____ ___ / | / __ \/ _/" )
@@ -35,6 +50,14 @@ def print_title():
3550
3651
3752def check_controller_connection (left_data , right_data ):
53+ """
54+ Check that both controllers are connected. If not, attempt re-connection.
55+
56+ :param str left_data: Left controller button values from the etee driver. If a controller disconnects, the values in the buffer will reset to None.
57+ :param str right_data: Right controller button values from the etee driver. If a controller disconnects, the values in the buffer will reset to None.
58+ :return: True if both controllers are still connected; False if otherwise
59+ :rtype: bool
60+ """
3861 connection = True
3962 if left_data [0 ] == None and right_data [0 ] == None :
4063 print ("---" )
@@ -56,6 +79,7 @@ def check_controller_connection(left_data, right_data):
5679 connection = False
5780 return connection
5881
82+
5983if __name__ == "__main__" :
6084 # Initialise the etee driver and find dongle
6185 etee = EteeController ()
0 commit comments