• <table id="0ws66"></table>
  • <noscript id="0ws66"><source id="0ws66"></source></noscript>

    平臺提供的開關燈代碼,

    作者:Blue moon | 更新時間:2019-04-12 | 瀏覽量:926

    //處理網絡接收到到指令,執行相關動作
    void processMessage(aJsonObject *msg) {
      aJsonObject* method = aJson.getObjectItem(msg, "M");
      if (!method) {
        return;
      }
      String M = method->valuestring;
      if (M == "WELCOME TO BIGIOT") {
        checkOut();
        checkoutTime = millis();
        return;
      }
      if (M == "connected") {
        checkIn();
      }
      if (M == "say") {
        aJsonObject* content = aJson.getObjectItem(msg, "C");
        aJsonObject* client_id = aJson.getObjectItem(msg, "ID");
        String C = content->valuestring;
        String F_C_ID = client_id->valuestring;
        if (C == "play") {
          digitalWrite(LED, HIGH);
          say(F_C_ID, "LED on!");
        }
        if (C == "stop") {
          digitalWrite(LED, LOW);
          say(F_C_ID, "LED off!");
        }
      }

     

    哪位大佬幫看下這部分的代碼是什么意思啊?


    評論:共0條

    返回頂部
    国产综合在线