diff --git a/Practical/Assignment-2/IoT - Codes-2.py b/Practical/Assignment-2/IoT - Codes-2.py index f3c52e1..08353ca 100644 --- a/Practical/Assignment-2/IoT - Codes-2.py +++ b/Practical/Assignment-2/IoT - Codes-2.py @@ -12,14 +12,14 @@ import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO setwarnings(False) -GPIO.setup(12,GPIO.OUT) +GPIO.setup(16,GPIO.OUT) try: while True: print(“LED ON”) - GPIO.output(12,GPIO.HIGH) + GPIO.output(16,GPIO.HIGH) time.sleep(1) print(“LED OFF”) - GPIO.output(12,GPIO.LOW) + GPIO.output(16,GPIO.LOW) time.sleep(1) except: GPIO.cleanup() @@ -31,17 +31,17 @@ import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO setwarnings(False) -GPIO.setup(12,GPIO.OUT) -GPIO.setup(19,GPIO.OUT) +GPIO.setup(16,GPIO.OUT) +GPIO.setup(26,GPIO.OUT) try: while True: print(“LED ON”) - GPIO.output(12,GPIO.HIGH) - GPIO.output(19,GPIO.HIGH) + GPIO.output(16,GPIO.HIGH) + GPIO.output(26,GPIO.HIGH) time.sleep(1) print(“LED OFF”) - GPIO.output(12,GPIO.LOW) - GPIO.output(19,GPIO.LOW) + GPIO.output(16,GPIO.LOW) + GPIO.output(26,GPIO.LOW) time.sleep(1) except: GPIO.cleanup() @@ -53,17 +53,17 @@ import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) -GPIO.setup(12,GPIO.OUT) -GPIO.setup(19,GPIO.OUT) +GPIO.setup(16,GPIO.OUT) +GPIO.setup(26,GPIO.OUT) try: while True: print("LED Buzzer ON") - GPIO.output(12,GPIO.HIGH) - GPIO.output(19,GPIO.HIGH) + GPIO.output(16,GPIO.HIGH) + GPIO.output(26,GPIO.HIGH) time.sleep(1) print("LED & Buzzer OFF") - GPIO.output(12,GPIO.LOW) - GPIO.output(19,GPIO.LOW) + GPIO.output(16,GPIO.LOW) + GPIO.output(26,GPIO.LOW) time.sleep(1) except: GPIO.cleanup() diff --git a/Practical/Assignment-3/IoT - Code-3.py b/Practical/Assignment-3/IoT - Code-3.py old mode 100755 new mode 100644 diff --git a/Practical/Water-level.py b/Practical/Water-level.py index ea95a65..f631ef1 100644 --- a/Practical/Water-level.py +++ b/Practical/Water-level.py @@ -14,14 +14,14 @@ GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) 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 +GPIO.setup(26, GPIO.OUT) # Set GPIO 6 as output for LED try: while True: if (GPIO.input(16)) - GPIO.output(6, True) # Turn ON LED if water detected + GPIO.output(26, True) # Turn ON LED if water detected else - GPIO.output(6, False) # Keep LED OFF if no water detected + GPIO.output(26, False) # Keep LED OFF if no water detected except KeyboardInterrupt: GPIO.cleanup() print("Program exited by user.")