<s> import ledcontroller <EOL> from thebutton import TheButton <EOL> import math <EOL> class ButtonApp ( ) : <EOL> def __init__ ( self ) : <EOL> CONTROLLER_ADDRESS = "<STR_LIT>" <EOL> self . led = ledcontroller . LedController ( CONTROLLER_ADDRESS ) <EOL> self . group = <NUM_LIT:0> <EOL> self . the_button = TheButton ( ) <EOL> self . last_lowest = <NUM_LIT> <EOL> def run ( self ) : <EOL> self . the_button . start ( ) <EOL> previous_colour = '<STR_LIT:0>' <EOL> try : <EOL> while True : <EOL> colour = self . the_button . limitless_colour <EOL> if colour != previous_colour : <EOL> self . led . set_color ( colour , self . group ) <EOL> previous_colour = colour <EOL> if self . the_button . lowest_time < self . last_lowest : <EOL> self . led . set_color ( '<STR_LIT>' , self . group ) <EOL> self . led . set_color ( colour , self . group ) <EOL> self . last_lowest = self . the_button . lowest_time <EOL> print ( "<STR_LIT>" + str ( math . floor ( self . last_lowest ) ) ) <EOL> previous_colour = '<STR_LIT:0>' <EOL> except KeyboardInterrupt : <EOL> pass <EOL> self . close ( ) <EOL> def close ( self ) : <EOL> self . the_button . close ( ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> button_app = ButtonApp ( ) <EOL> button_app . run ( ) </s>
