CL2_IIOT Practical
IIOT Manual practical 2: import time from datetime import datetime import requests # Simulate Raspberry Pi GPIO on Windows class GPIO : BCM = 11 IN = 1 @ staticmethod def setmode ( mode ): print ( "GPIO mode configured" ) @ staticmethod def setup ( pin , mode ): print ( "PIR sensor initialized" ) @ staticmethod def input ( pin ): return 1 # Simulates motion detected @ staticmethod def cleanup (): print ( "GPIO cleanup completed" ) # Telegram bot details BOT_TOKEN = "YOUR_BOT_TOKEN" CHAT_ID = "YOUR_CHAT_ID" # PIR sensor settings PIR_PIN = 17 WARMUP_SECONDS = 30 COOLDOWN_SECONDS = 10 # GPIO configuration GPIO . setmode ( GPIO . BCM ) GPIO . setup ( PIR_PIN , GPIO . IN ) # Function to send Telegram alert...