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
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.