shutdown()

描述

中断与 GSM 网路的连线藉由关闭 Arduino GSM shield。

语法


gsm.shutdown()

参数

无参数

回传

boolean:函式执行成功时回传 1,正在执行回传 0

范例

#include <GSM.h>

#define PINNUMBER ""

GSM gsm;

void setup()
{
  // 初始化 Serial
  Serial.begin(9600);

  // 连线状态
  boolean notConnected = true;

  // 启动 Arduino GSM shield,如果你的 SIM 卡有 PIN 码,请当作 begin() 的参数
  while(notConnected)
  {
    if(gsm.begin(PINNUMBER)==GSM_READY)
      notConnected = false;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }

  Serial.println("GSM initialized");

  gsm.shutdown();
  Serial.println("GSM terminated");

}

void loop()
{
  //  不做任何事
}

See also

GSM constructor
begin()


函式库参考主页面

The text of the 86Duino reference is a modification of the Arduino reference, and is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.