arduino_wifi_pcs

arduino_wifi_pcs

c.s.park
2022年11月17日
  • 7.0

    Android OS

このarduino_wifi_pcsについて

Arduino Wi-Fi UI

ArduinoボードにWi-Fiモジュールを装着し、携帯電話から見たアプリを操作して携帯電話とArduinoの間にWi-Fi通信を接続し、携帯電話に装備されている10個のボタンを押して、そのボタンの押下をArduinoで認識して希望の動作を許可するアプリ

- シングルボタン:10個

(各ボタンを押したときにArduinoに送信されるデータ)

ボタン1:「0」(16進数30)ボタン2:「1」(16進数31)

ボタン3:「2」(16進数32)ボタン4:「3」(16進数33)

ボタン5:「4」(16進数34)ボタン6:「5」(16進数35)

ボタン7:「6」(16進数36)ボタン8:「7」(16進数37)

ボタン9:「8」(16進数38)ボタン10:「9」(16進数39)

(Aduinoのプログラム例)

Arduinoのデジタルポート5番に接続されているLEDをボタン1を1回押すと点灯し、もう一度押すと消灯します。

///// Wi-FiでLEDを制御する

最初の部分にSoftwareSerial.hをインクルードします。

SoftwareSerial esp8266(2,3);

void setup()

{

Serial.begin(9600);

esp8266.begin(9600); // espのボーレート

pinMode(5、OUTPUT);

digitalWrite(、LOW);

sendData("AT+RST\r\n",2000); // モジュールのリセット

sendData("AT+CWMODE=2\r\n",1000); // AP(アクセスポイント)に設定

sendData("AT+CIFSR\r\n",1000); // ipアドレスを取得

sendData("AT+CIPMUX=1\r\n",1000); // multiple connection に設定

sendData("AT+CIPSERVER=1,80\r\n",1000); // port 80でサーバー on

}

void loop()

{

if(esp8266.available()) // esp がメッセージを送信している場合

{

if(esp8266.find("+IPD,"))

{

delay(200); //すべてのシリアルデータリード

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コマンド

String closeCommand = "AT+CIPCLOSE=";

closeCommand += connectionId; // connection idを付ける

closeCommand += "\r\n";

sendData(closeCommand、1000); // close connection

}

}

}

String sendData(String command, const int timeout)

{

String response = "";

esp8266.print(command); // 読み取った文字を esp8266 に転送

long int time = millis();

while( (time+timeout) > millis())

{

while(esp8266.available())

{

// espに受信データがある場合はシリアルに送信

char c = esp8266.read(); //次の文字を読む

response + = c;

}

}

return response;

}

もっと見る

最新バージョン 1.1.0 の更新情報

Last updated on 2022年11月17日
Minor bug fixes and improvements. Install or update to the newest version to check it out!
もっと見る

ビデオとスクリーンショット

  • arduino_wifi_pcs ポスター
  • arduino_wifi_pcs スクリーンショット 1
  • arduino_wifi_pcs スクリーンショット 2
  • arduino_wifi_pcs スクリーンショット 3
  • arduino_wifi_pcs スクリーンショット 4
  • arduino_wifi_pcs スクリーンショット 5
  • arduino_wifi_pcs スクリーンショット 6
  • arduino_wifi_pcs スクリーンショット 7
APKPure アイコン

APKPureアプリで超高速かつ安全にダウンロード

Android で XAPK/APK ファイルをワンクリックでインストール!

ダウンロード APKPure
thank icon
We use cookies and other technologies on this website to enhance your user experience.
By clicking any link on this page you are giving your consent to our Privacy Policy and Cookies Policy.
Learn More about Policies