當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Arduino MKRNB - shutdown()用法及代碼示例

說明

通過關閉調製解調器電源斷開與 SIM 卡上標識的 NB 網絡的連接。

用法

nb.shutdown()

參數

返回

如果成功則為真

示例

#include <MKRNB.h>

#define PINNUMBER ""

NB nb; // include a 'true' parameter for debug enabled

void setup()
{
  // initialize serial communications
  Serial.begin(9600);

  // connection state
  boolean notConnected = true;

  // StartNB Module
  // If your SIM has PIN, pass it as a parameter of begin() in quotes
  while(notConnected)
  {
    if(nb.begin(PINNUMBER)==NB_READY)
      notConnected = false;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }

  Serial.println("NB initialized");

  nb.shutdown();
  Serial.println("NB terminated");

}

void loop()
{
}

相關用法


注:本文由純淨天空篩選整理自arduino.cc大神的英文原創作品 MKRNB - shutdown()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。