diff --git a/Practical/Assignment-5/IoT - Handout-5.pdf b/Practical/Assignment-5/IoT - Handout-5.pdf new file mode 100644 index 0000000..e8fdb16 Binary files /dev/null and b/Practical/Assignment-5/IoT - Handout-5.pdf differ diff --git a/Practical/Water level code.py b/Practical/Assignment-6/IoT - Code-6.py similarity index 69% rename from Practical/Water level code.py rename to Practical/Assignment-6/IoT - Code-6.py index 61b0072..ea95a65 100644 --- a/Practical/Water level code.py +++ b/Practical/Assignment-6/IoT - Code-6.py @@ -16,11 +16,13 @@ GPIO.cleanup() GPIO.setup(16, GPIO.IN) # Set GPIO 16 as input for water level sensor signal GPIO.setup(6, GPIO.OUT) # Set GPIO 6 as output for LED -while True: - if (GPIO.input(16)) - GPIO.output(6, True) # Turn ON LED if water detected - else - GPIO.output(6, False) # Keep LED OFF if no water detected - -GPIO.cleanup() +try: + while True: + if (GPIO.input(16)) + GPIO.output(6, True) # Turn ON LED if water detected + else + GPIO.output(6, False) # Keep LED OFF if no water detected +except KeyboardInterrupt: + GPIO.cleanup() + print("Program exited by user.") # END OF CODE diff --git a/README.md b/README.md index d2c7c03..e8edc20 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ 2. [Assignment-2](https://git.kska.io/sppu-te-comp-content/InternetOfThingsAndEmbeddedSystems/src/branch/main/Practical/Assignment-2/) 3. [Assignment-3](https://git.kska.io/sppu-te-comp-content/InternetOfThingsAndEmbeddedSystems/src/branch/main/Practical/Assignment-3/) 4. [Assignment-4](https://git.kska.io/sppu-te-comp-content/InternetOfThingsAndEmbeddedSystems/src/branch/main/Practical/Assignment-4/) +5. [Assignment-5](https://git.kska.io/sppu-te-comp-content/InternetOfThingsAndEmbeddedSystems/src/branch/main/Practical/Assignment-5/) ## Question Papers - [IN-SEM](https://git.kska.io/sppu-te-comp-content/InternetOfThingsAndEmbeddedSystems/src/branch/main/Question%20Papers/IN-SEM)