This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Adafruit_SSD1306 | |
| from PIL import Image, ImageDraw, ImageFont | |
| import os | |
| # Initialize the OLED display | |
| disp = Adafruit_SSD1306.SSD1306_128_64(rst=None) # Adjust resolution if necessary | |
| disp.begin() | |
| disp.clear() | |
| disp.display() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| import numpy as np | |
| import tflite_runtime.interpreter as tflite | |
| from picamera2 import Picamera2 | |
| # Load the TensorFlow Lite model | |
| MODEL_PATH = "model.tflite" # Replace with your model path | |
| LABELS_PATH = "labels.txt" # Replace with your labels file | |
| def load_labels(labels_path): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Adafruit_DHT | |
| import time | |
| # Set sensor type and GPIO pin | |
| DHT_SENSOR = Adafruit_DHT.DHT22 | |
| DHT_PIN = 4 # Replace with the GPIO pin connected to the DATA pin | |
| try: | |
| print("Press Ctrl+C to exit.") | |
| while True: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //declare all sensor pin | |
| const int OPP_L = 13; | |
| const int OPP_R = 3; | |
| const int OPP_FL = 12; | |
| const int OPP_FR = 10; | |
| const int OPP_FC = 11; | |
| const int EDGE_R = A0; | |
| const int EDGE_L = A1; | |
| const int button = A4; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "CytronMotorDriver.h" //library for motor driver | |
| #define L 13 //left opponent sensor | |
| #define FL 12 //centre left opponent sensor | |
| #define FC 11 //centre opponent sensor | |
| #define FR 10 //centre right opponent sensor | |
| #define R 3 //right opponent sensor | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define BLYNK_TEMPLATE_ID "TMPL6kGCXF7mI" | |
| #define BLYNK_TEMPLATE_NAME "Weather Monitoring System" | |
| #define BLYNK_AUTH_TOKEN "RI2qfZ9ozSPqf0hBziP7yqMyD3R3na25" | |
| #define BLYNK_PRINT Serial // Comment this out to disable prints and save space | |
| #include <ESP8266WiFi.h> | |
| #include <BlynkSimpleEsp8266.h> | |
| #include <DHT.h> | |
| char auth[] = "RI2qfZ9ozSPqf0hBziP7yqMyD3R3na25"; //Enter the Auth code which was send by Blink |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //home automation | |
| #define BLYNK_TEMPLATE_ID "TMPL6_z4SFJ7d" | |
| #define BLYNK_TEMPLATE_NAME "Home Automation" | |
| #define BLYNK_AUTH_TOKEN "rzuUuTusqFRtKiCnolfgekU3AS2LWmGz" | |
| #define BLYNK_PRINT Serial // Comment this out to disable prints and save space | |
| #include <ESP8266WiFi.h> | |
| #include <BlynkSimpleEsp8266.h> | |
| #include <DHT.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //smoke detection | |
| #define BLYNK_TEMPLATE_ID "TMPL6kGCXF7mI" | |
| #define BLYNK_TEMPLATE_NAME "Smoke and Flame alert system" | |
| #define BLYNK_AUTH_TOKEN "RI2qfZ9ozSPqf0hBziP7yqMyD3R3na25" | |
| #define BLYNK_PRINT Serial // Comment this out to disable prints and save space | |
| //Blynk MQ-2 Smoke Detector By Yuvanesan Vijayan | |
| #include <ESP8266WiFi.h> | |
| #include <BlynkSimpleEsp8266.h> | |
| #define BLYNK_PRINT Serial // Comment this out to disable prints and save space |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define BLYNK_TEMPLATE_ID "TMPL6vKaJSjxW" | |
| #define BLYNK_TEMPLATE_NAME "LED CONTROL" | |
| #define BLYNK_AUTH_TOKEN "jJQPIde8-KrCF42IVkiTeOvHodDjPo02" | |
| //Blynk LED On OFF | |
| #include <ESP8266WiFi.h> | |
| #include <BlynkSimpleEsp8266.h> | |
| #define BLYNK_PRINT Serial // Comment this out to disable prints and save space | |
| char auth[] = "jJQPIde8-KrCF42IVkiTeOvHodDjPo02"; //Enter the Auth code which was send by Blynk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //rain detection | |
| #define BLYNK_TEMPLATE_ID "TMPL6kGCXF7mI" | |
| #define BLYNK_TEMPLATE_NAME "Rain Monitoring System" | |
| #define BLYNK_AUTH_TOKEN "RI2qfZ9ozSPqf0hBziP7yqMyD3R3na25" | |
| #define BLYNK_PRINT Serial // Comment this out to disable prints and save space | |
| #include <ESP8266WiFi.h> | |
| #include <BlynkSimpleEsp8266.h> | |
| char auth[] = "RI2qfZ9ozSPqf0hBziP7yqMyD3R3na25"; //Enter the Auth code which was send by Blink | |
| char ssid[] = "Cytron"; //Replace with your WIFI Name |
NewerOlder