Skip to content

Commit

Permalink
CHG: Reactivation of time.sleep for CPU idle
Browse files Browse the repository at this point in the history
* Reactivation of time.sleep for CPU idle
** 200 ms delay for CPU idle and other processes
** Too long a delay will have a negative effect on the coin detection and the lockout relay
* Update time.sleep(0.1)
** Set CPU sleep time to 0,1 second. CPU workload then is 15%, thats fine. 0,2 s would be 10% and 0,01 would be 25-30%. Nothing would be 100%.
  • Loading branch information
AxelHamburch authored Jul 4, 2022
1 parent f09b9fe commit 1764c16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,10 @@ def coins_inserted():
def monitor_coins_and_button():
"""Monitors coins inserted and buttons pushed
"""
# time.sleep(0.5)

# 200 ms sleep for CPU idle and other processes
time.sleep(0.1)
# Too long a delay will have a negative effect on the coin detection and the lockout relay

#Wifi monitoring causes undesirable behavior sometimes.
#ssid=check_connectivity()
Expand Down

0 comments on commit 1764c16

Please sign in to comment.