diff --git a/Practical/Assignment-4/IoT - Code-4.py b/Practical/Assignment-4/IoT - Code-4.py index 9e6c41f..b5df6d7 100644 --- a/Practical/Assignment-4/IoT - Code-4.py +++ b/Practical/Assignment-4/IoT - Code-4.py @@ -6,6 +6,13 @@ Problem Statement: Temperature and humidity sensing using DHT11. Code from InternetOfThingsAndEmbeddedSystems (SPPU - Third Year - Computer Engineering - Content) repository on KSKA Git: https://git.kska.io/sppu-te-comp-content/InternetOfThingsAndEmbeddedSystems """ +# NOTE: PLEASE REFER DHT11 repo by notkshitij for initialization: https://git.kska.io/notkshitij/DHT11/ + +# This code will only work in the virtual environment +# To enable the virtual environment, change current working directory using 'cd ' +# Activate the virtual environment using 'source bin/activate' +# Run this code 'python3 IoT\ -\ Code-4.py' + # BEGINNING OF CODE # NOTE: GPIO PIN 16 used @@ -29,6 +36,8 @@ try: print("Humidity: %-3.1f %%" % result.humidity) else: print("Error: %d" % result.error_code) + # Error 1 implies sensor not detected, thus no data + # Error 2 implies checksum error, data corrupted, i.e. GPIO connection might be lose time.sleep(3) except KeyboardInterrupt: print("Program stopped by user.")