Last active
October 29, 2017 14:58
-
-
Save KazuyukiEguchi/ad4c803ce5deacf7a130a2eb9559c984 to your computer and use it in GitHub Desktop.
Wio LTEで、mineo au SIMで使ってみる。 ref: http://qiita.com/KazuyukiEguchi/items/bf9a6c3a3bc7abf128c7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WioLTEforArduino.h> | |
#include <limits.h> | |
WioLTE Wio; | |
void setup() { | |
// put your setup code here, to run once: | |
delay(200); | |
SerialUSB.println(""); | |
SerialUSB.println("--- START ---------------------------------------------------"); | |
SerialUSB.println("### I/O Initialize."); | |
Wio.Init(); | |
SerialUSB.println("### Power supply ON."); | |
Wio.PowerSupplyLTE(true); | |
delay(5000); | |
SerialUSB.println("### Turn on or reset."); | |
if (!Wio.TurnOnOrReset()) { | |
SerialUSB.println("### ERROR! ###"); | |
return; | |
} | |
delay(3000); | |
if(Wio.Activate("mineo.jp", "mineo@k-opti.com", "mineo") == true) | |
{ | |
SerialUSB.println("Activate is True"); | |
} | |
else | |
{ | |
SerialUSB.println("Activate is False"); | |
} | |
} | |
void loop() { | |
char num[20]; | |
// put your main code here, to run repeatedly: | |
SerialUSB.println("..."); | |
if(Wio.IsBusy() == false) { | |
if(Wio.GetPhoneNumber(num,sizeof(num)) > 0) { | |
SerialUSB.println(num); | |
} | |
} | |
int rssi = Wio.GetReceivedSignalStrength(); | |
if (rssi == INT_MIN) { | |
SerialUSB.println("### ERROR! ###"); | |
goto err; | |
} | |
SerialUSB.print("RSSI:"); | |
SerialUSB.print(rssi); | |
SerialUSB.println(""); | |
err: | |
delay(5000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment