diff --git a/devtimer.py b/devtimer.py index cc8a38b..601b84b 100755 --- a/devtimer.py +++ b/devtimer.py @@ -50,7 +50,6 @@ display can handle. So ... the total compensation cannot reduce the virtual second to less than about 0.300 to be on the safe side. - ''' compensate = ( @@ -66,6 +65,11 @@ print("Beep!") +# Get currently selected media/developer profile + +def get_profile(): + return 0 + # Return the current temperature in degrees F def get_temp(): @@ -96,10 +100,13 @@ if __name__ == "__main__": + # Setup the hardware + wiringPiSetupGpio() display0 = TM1637(CLK0, DIO0, BRIGHTNESS0) - compensation_profile = 0 + # Start timing, using the selected profile and measured temperature + elapsed_time = 0 while True: @@ -112,7 +119,7 @@ last = time() update_thread = Thread(None, show_elapsed, None, (display0, elapsed_time)) - sleep(1.000 + ((NORMAL_TEMP-get_temp()) * compensate[0]) - CALIBRATION_OFFSET) + sleep(1.000 + ((NORMAL_TEMP-get_temp()) * compensate[get_profile()]) - CALIBRATION_OFFSET) elapsed_time += 1 elapsed_time %= 6000 update_thread = Thread(None, show_elapsed, None, (display0, elapsed_time))