///////////////////////////////////////////////node mcu code
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <Servo.h>
#include <SoftwareSerial.h>
SoftwareSerial S(3,1); // rx tx
String command; //String to store app command state.
//const char* ssid = "virus";
const char *ssid = "bolbonabc";
const char *password = "thereisnospoon";
ESP8266WebServer server(80);
void setup() {
S.begin(115200);
//new line add
S.println();
S.print("Configuring access point...");
/* You can remove the password parameter if you want the AP to be open. */
WiFi.softAP(ssid, password);
IPAddress myIP = WiFi.softAPIP();
S.print("AP IP address: ");
S.println(myIP);
server.on("/",HTTP_handleRoot);
server.begin();
S.println("HTTP server started");
}
void loop() {
server.handleClient();
command = server.arg("State");
/* if(isNumeric(command))
{
val = command.toInt(); // reads the value of the potentiometer (value between 0 and 1023)
// Serial.println("command to int "+val);
val = map(val, 0, 1023, 0, 180); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
}
*/
}
bool isNumeric(String str)
{
for (byte i=0;i<str.length();i++)
if(isDigit(str.charAt(i)))
{
return true;
}
return false;
}
void HTTP_handleRoot(void)
{
if( server.hasArg("State") )
{
S.println(server.arg("State"));
}
server.send ( 200, "text/html", "" );
}
/////////////////////////////////////////////////////////// arduino code
#include <SoftwareSerial.h>
SoftwareSerial s(2,3); // rx tx
void setup()
{
s.begin(9600);
}
void loop()
{
int data = 1000;
if(s.available()>0)
{
s.write(data);
}
}
////////////////////////circuit connection
node mcu arduino
tx rx
rx tx
/////////////////////////////// arduino out put sent from android app arduino serial --input " a b c d e f g h i j k l m n o p q r s d u v w x y z"
A b c d e f g h i j k l m n o q r s t u v w x y z a b c d e f g h i j k l m n o p q r s d u v w x y z A B C d E f g h i J k l m n o
q r s t u v w p y z
a b c d e f g h i j k l m n o p q r s t u v w p y z
a b c d e F g h i j k l m n o p q r s t u v w p q z
a b C d E f g h i j k l m n o q r s t u v w p q z a b c d E F g h i j k l m n o
q r s t u v w p q z
a b c d e f g h i j k l m n o p q r s d u v w x y z
a b C d E F g h i j k l m n o q r s t u v w p q z a b C d E f g h i j k l m n o
q r s tu v w x y z a b c d e f g h i j k l m n o p q r s d u v w x y z a b c d e f g h i j k l m n o p q r s d u v w x y r a b c d e f g h i j k l m n o p q r s d u v w x y z a b c d e f g h i j k l m n o p q r s d u v w x y z A b C d E f g h i J k l m n o
q r s t u v w p y z
a b c d e F g h i j k l m n o p q r s t u v w x q z
a b c d e f g h i j k l l n o q r s t u v w x y z A b C d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s t u v w x q z a b c d e f g h i j k l m n o p q r s d u v w x y z A b c d e f g h i j k l m n o
q r s t u v w x y z
a b c d e f g h i j k l m n o q r s t u v w x y z a b c d e F g h i j k l m n o p q r s t u v w x q z a b c d e F g h i j k l m n o p q r s t u v w x q z a b c d e F g h i j k l m n o p q r s t u v w x q z a b c d e f g h i j k l m n o
q r s d u v w p y z
A b C d E f g h i j k l m n o q r s t u v w p y z A b c d e f g h i j k l m n o
r s t u v βΈ®@x y z a b c d e f g h i j k l m n o p q r s t u v w x y z a b c d e f g h i j k l m n o p q r s d u v w x y z A b c d e f g h i j k l m n o
q r s t q v w x y z
A
////////////////////////apk link bellow