JustPaste
HomeCategoriesAboutDonateContactTerms of UsePrivacy Policy
JustPaste

Free online notepad — write and share instantly

Navigate

  • Home
  • Timeline
  • Categories

Info

  • About
  • Donate
  • Contact

Legal

  • Terms of Use
  • Privacy Policy

© 2026 JustPaste.app. All rights reserved.

Made with ♥ by JustPaste

Untitled Page | JustPaste.app
7 days ago2 views
👨‍💻Programming

Untitled Page

1a  void setup() { 
pinMode(2,OUTPUT); 
} 
void loop() { 
// p ut your main code here, to run repeatedly: 
digitalWrite(2,HIGH); 
delay(1000); 
digitalWrite(2,LOW);  
delay(1000); 
} 

1b void setup() { 
pinMode(2,OUTPUT); 
pinMode(35,INPUT); 
} 
void loop() { 
if (digitalRead (35)==HIGH) 
{ 
digitalWrite(2,HIGH); 
} 
else 
{ 
digitalWrite(2,LOW);  
} 
} 

2 void setup() { 
pinMode(2,OUTPUT); 
pinMode(35,INPUT); 
} 
void loop() { 
if (analogRead (36)<= 800) 
{ 
digitalWrite(2,HIGH); 
} 
else 
{ 
digitalWrite(2,LOW);  
} 
} 

3 #include "DHT.h" 
#define DHTPIN 4 
#define DHTTYPE DHT11 
DHT dht(DHTPIN, DHTTYPE); 
void setup() { 
Serial.begin(115200); 
dht.begin(); 
} 
 
void loop() { 
  float h = dht.readHumidity(); 
  float t = dht.readTemperature(); 
 
  Serial.print("Humidity: "); 
  Serial.print(h); 
  Serial.print("% Temperature: "); 
  Serial.print(t); 
  Serial.println("°C"); 
 
  delay(2000); 
} 
 

4  const int IR_PIN = 33; 
const int BUZZER_PIN = 14; 
 
void setup() { 
  Serial.begin(115200); 
  pinMode(IR_PIN, INPUT); 
  pinMode(BUZZER_PIN, OUTPUT); 
} 
 
void loop() { 
  if (digitalRead(IR_PIN) == LOW) { 
    Serial.println("Obstacle Detected!"); 
    digitalWrite(BUZZER_PIN, HIGH); 
  } else { 
    Serial.println("No Obstacle"); 
    digitalWrite(BUZZER_PIN, LOW); 
  } 
  delay(400); 
} 
 
5#include <LiquidCrystal_I2C.h> 
LiquidCrystal_I2C lcd(0x27, 16, 2); 
void setup() { 
  lcd.init(); 
  lcd.backlight(); 
} 
 
void loop() { 
  lcd.setCursor(0, 0); 
  lcd.print("Your Name"); 
  lcd.setCursor(0, 1); 
  lcd.print("Sem: 5"); 
  delay(2000); 
 
  lcd.clear(); 
  lcd.print("Dept: CSE"); 
  lcd.setCursor(0, 1); 
  lcd.print("College: GAT"); 
  delay(2000); 
  lcd.clear(); 
} 
 
 
6#include <LiquidCrystal_I2C.h> 
LiquidCrystal_I2C lcd(0x27, 16, 2); 
 
#define TRIG 12 
#define ECHO 35 
 
void setup() { 
  pinMode(TRIG, OUTPUT); 
  pinMode(ECHO, INPUT); 
  lcd.init(); 
  lcd.backlight(); 
} 
void loop() { 
  digitalWrite(TRIG, LOW); 
  delayMicroseconds(2); 
  digitalWrite(TRIG, HIGH); 
  delayMicroseconds(10); 
  digitalWrite(TRIG, LOW); 
 
  float distance = pulseIn(ECHO, HIGH) * 0.0343 / 2; 
  lcd.clear(); 
  lcd.print("Dist: "); 
  lcd.print(distance); 
  lcd.print(" cm"); 
 
  delay(500); 
} 
 
7a #include "WiFi.h" 
 
void setup() { 
  Serial.begin(115200); 
  WiFi.mode(WIFI_STA); 
} 
 
void loop() { 
  int n = WiFi.scanNetworks(); 
 
  for (int i = 0; i < n; i++) { 
    Serial.println(WiFi.SSID(i)); 
  } 
 
  delay(5000); 
} 
7b #include <WiFi.h> 
 
const char* ssid = "MyESP32"; 
const char* password = "123456"; 
 
void setup() { 
  Serial.begin(115200); 
  WiFi.softAP(ssid, password); 
  Serial.println(WiFi.softAPIP()); 
} 
 
void loop() { 
  delay(500); 
} 
 
 
8#include <WiFi.h> 
 
char ssid[] = "Your_SSID"; 
char password[] = "Your_Password"; 
 
void setup() { 
  Serial.begin(115200); 
  WiFi.begin(ssid, password); 
 
  while (WiFi.status() != WL_CONNECTED) 
    delay(300); 
 
  Serial.println(WiFi.localIP()); 
  Serial.println(WiFi.gatewayIP()); 
} 
 
void loop() {} 
  
9a #include <WiFi.h> 
 
const char* ssid = "Mahesh"; 
const char* password = "012345678"; 
 
WiFiServer server(80); 
 
void setup() { 
  Serial.begin(115200); 
  pinMode(2, OUTPUT); 
  WiFi.begin(ssid, password); 
 
  while (WiFi.status() != WL_CONNECTED) 
    delay(500); 
 
  Serial.println(WiFi.localIP()); 
  server.begin(); 
} 
 
void loop() { 
  WiFiClient client = server.available(); 
 
  if (client) { 
    String req = client.readStringUntil('\r'); 
 
    if (req.indexOf("/H") >= 0) digitalWrite(2, HIGH); 
    if (req.indexOf("/L") >= 0) digitalWrite(2, LOW); 
 
    client.println("HTTP/1.1 200 OK"); 
    client.println("Content-Type: text/html\n"); 
    client.println("<a href='/H'>ON</a><br><a href='/L'>OFF</a>"); 
    client.stop(); 
  } 
} 
 
 
9b #include <WiFi.h> 
#include <WebServer.h> 
#include "DHT.h" 
 
#define DHTPIN 4 
#define DHTTYPE DHT11 
 
const char* ssid = "Your_SSID"; 
const char* password = "Your_Password"; 
 
DHT dht(DHTPIN, DHTTYPE); 
WebServer server(80); 
 
void setup() { 
  Serial.begin(115200); 
  dht.begin(); 
  WiFi.begin(ssid, password); 
 
  while (WiFi.status() != WL_CONNECTED) 
    delay(500); 
 
  server.on("/", []() { 
    server.send(200, "text/html", 
      "Temperature: " + String(dht.readTemperature()) + 
      " C<br>Humidity: " + String(dht.readHumidity()) + "%"); 
  }); 
 
  server.begin(); 
} 
 
void loop() { 
  server.handleClient(); 
}

⚠️Content was pasted as plain text and auto-formatted as a code block. Use the Code Block button in the editor for proper formatting.

← Back to timeline