arduino_wifi_pcs

10+
Downloads
Content rating
Everyone
Screenshot image
Screenshot image
Screenshot image
Screenshot image
Screenshot image
Screenshot image
Screenshot image
Screenshot image
Screenshot image
Screenshot image
Screenshot image
Screenshot image
Screenshot image
Screenshot image
Screenshot image

About this app

After mounting the Wi-Fi module on the Arduino board, operating this app on the mobile phone to connect the Wi-Fi communication between the mobile phone and Arduino, pressing the 10 buttons provided on the mobile phone to recognize the pressing of the button on the Arduino to perform the desired operation. app that allows
- Single button: 10

(Data sent to Arduino when each button is pressed)
Button 1: ‘0’ (hexadecimal 30) Button 2: ‘1’ (hexadecimal 31)
Button 3: ‘2’ (hexadecimal 32) Button 4: ‘3’ (hexadecimal 33)
Button 5: ‘4’ (hexadecimal 34) Button 6: ‘5’ (hexadecimal 35)
Button 7: ‘6’ (hexadecimal 36) Button 8: ‘7’ (hexadecimal 37)
Button 9: ‘8’ (hexadecimal 38) Button 10: ‘9’ (hexadecimal 39)

(Example of program in Arduino)
LED connected to digital port 5 of Arduino turns on when button 1 is pressed once, and turns off when pressed again. (Toggle action)

///// Controlling LEDs via Wi-Fi
Include SoftwareSerial.h in the first part.
SoftwareSerial esp8266(2,3);

void setup()
{
Serial. begin(9600);
esp8266.begin(9600); // baud rate of esp
pinMode(5, OUTPUT);
digitalWrite(, LOW);

sendData("AT+RST\r\n",2000); // module reset
sendData("AT+CWMODE=2\r\n",1000); // set as AP (access point)
sendData("AT+CIFSR\r\n",1000); // get ip address
sendData("AT+CIPMUX=1\r\n",1000); // set to multiple connections
sendData("AT+CIPSERVER=1,80\r\n",1000); // server on port 80
}

void loop()
{
if(esp8266.available()) // if esp is sending a message
{
if(esp8266.find("+IPD,"))
{
delay(200); // read all serial data
int connectionId = esp8266.read();
esp8266.find("?");
int Number = esp8266.read();

if(Number==0x30){
if(digitalRead(5)==HIGH) digitalWrite(5, LOW);
else digitalWrite(5, HIGH);
}

// close command
String closeCommand = "AT+CIPCLOSE=";
closeCommand += connectionId; // attach connection id
closeCommand += "\r\n";
sendData(closeCommand,1000); // close connection
}
}
}

String sendData(String command, const int timeout)
{
String response = "";
esp8266.print(command); // send read character to esp8266
long int time = millis();
while( (time+timeout) > millis())
{
while(esp8266.available())
{
// If there is received data in esp, send it serially
char c = esp8266.read(); // read the next character
response+=c;
}
}
return response;
}
Updated on
Nov 17, 2022

Data safety

Safety starts with understanding how developers collect and share your data. Data privacy and security practices may vary based on your use, region, and age. The developer provided this information and may update it over time.
No data shared with third parties
Learn more about how developers declare sharing
No data collected
Learn more about how developers declare collection

What's new

2022.11.18 Version 1.1 출시. minSDK : 26에서 24로 변경