Dinesh Kshatriyan
Published

SWED (Smart Wearable For Epilepsy Disorder)

A watch type wearable called SWED is an epilepsy patient monitoring device with some additional detection and symptoms pre-alert system.

IntermediateWork in progress595
SWED (Smart Wearable For Epilepsy Disorder)

Things used in this project

Hardware components

AVR-IoT WG Development Board
Microchip AVR-IoT WG Development Board
×1

Software apps and online services

Cloud IoT Core
Google Cloud IoT Core

Story

Read more

Schematics

electronics-07-00405-g001_nx0eqltJMp.webp

Code

Untitled file

C/C++
#include <ESP8266WebServer.h>
ESP8266WebServer server;

const char username[] = "2socket";
const char password[] = "87654321";

int one = 5;
int two = 4;

void setup()
{
  pinMode(one, OUTPUT);
  pinMode(two, OUTPUT);
  Serial.begin(115200);
  WiFi.softAP(username, password);
  IPAddress myip = WiFi.softAPIP();
  Serial.println("Conected IP: ");
  Serial.println(myip);
  server.begin();
  server.on("/sp", sp);
}

void loop()
{
  server.handleClient();
}

void sp()
{
  String myhtml = "<html><head><title>Two Socket</title></head><body style = background-color:palegreen><h1><center>Inernet Of Things</center></h1><form><br><center><button name = \"pin\" type = \"submit\" value = \"0\"> Socket 1 ON </button><button name = \"pin\" type = \"submit\" value = \"1\"> Socket 1 OFF </button></center></form><form><br><center><button name = \"pin1\" type = \"submit\" value = \"0\"> Socket 2 ON </button><button name = \"pin1\" type = \"submit\" value = \"1\"> Socket 2 OFF </button></center></form></body></html>";
  server.send(200, "text/html", myhtml);

  if (server.arg("pin") == "1")
  {
    digitalWrite(one, LOW);    
  }
  else if (server.arg("pin") == "0")
  {
    digitalWrite(one, HIGH);
  }
  else if (server.arg("pin1") == "1")
  {
    digitalWrite(two, LOW);
  }
  else if (server.arg("pin1") == "0")
  {
    digitalWrite(two, HIGH);
  }
}

Credits

Dinesh Kshatriyan

Dinesh Kshatriyan

2 projects • 1 follower

Comments