Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add files via upload
# Publisher function for temperature
def publish_temperature_data(client):
    while True:
        temperature = random.uniform(18.0, 30.0)  # Simulate temperature in Celsius
        message = f"{temperature:.2f}"
        client.publish(temperature_topic, message)
        print(f"Published Temperature: {message} °C")
        time.sleep(5)  # Publish every 5 seconds
  • Loading branch information
kaurm105 committed Jul 31, 2024
1 parent 7433633 commit 74693d9
Showing 1 changed file with 0 additions and 0 deletions.
Binary file added Screenshot 2024-07-30 233608.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 74693d9

Please sign in to comment.