3
0

Compare commits

..

2 Commits

Author SHA1 Message Date
1110a2e034
Added softcopy for assignment 3. 2024-10-17 19:20:44 +05:30
5c45b27fec
Added code for IR sensor, i.e. assignment 3. 2024-10-17 19:11:52 +05:30
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
"""
THIS CODE HAS BEEN TESTED ON RASPBERRY PI 3B and 4B AND IS FULLY OPERATIONAL.
Problem Statement: IR Sensor
Code from InternetOfThingsAndEmbeddedSystems (SPPU - Third Year - Computer Engineering - Content) repository on KSKA Git: https://git.kska.io/sppu-te-comp-content/InternetOfThingsAndEmbeddedSystems
"""
# BEGINNING OF CODE
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.cleanup()
GPIO.setup(16,GPIO.IN)
try:
while True:
if (GPIO.input(16)):
print("No object")
else:
print("Object Detected")
except KeyboardInterrupt:
GPIO.cleanup()
# END OF CODE

Binary file not shown.