Last active
May 7, 2018 01:06
-
-
Save KazuyukiEguchi/9556441a6a92a9f4fe562a41192768b7 to your computer and use it in GitHub Desktop.
Wio 3Gを動かしてみた ref: https://qiita.com/KazuyukiEguchi/items/038b241a5d7b419b96d1
This file contains hidden or 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
--- START --------------------------------------------------- | |
### ## Power supply ON. | |
### Turn on or reset. | |
--- START --------------------------------------------------- | |
### I/O Initialize. | |
### Power supply ON. | |
### Turn on or reset. | |
### Connecting to "soracom.io". | |
### Setup completed. | |
This file contains hidden or 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
--- START --------------------------------------------------- | |
### ## Power supply ON. | |
### Turn on or reset. | |
--- START --------------------------------------------------- | |
### I/O Initialize. | |
### Power supply ON. | |
### Turn on or reset. | |
### Connecting to "soracom.io". | |
### Setup completed. | |
This file contains hidden or 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 <Wio3GforArduino.h> | |
#define APN "soracom.io" | |
#define USERNAME "sora" | |
#define PASSWORD "sora" | |
#define INTERVAL (60000) | |
Wio3G Wio; | |
void setup() { | |
delay(200); | |
SerialUSB.begin(115200); | |
SerialUSB.println(""); | |
SerialUSB.println("--- START ---------------------------------------------------"); | |
SerialUSB.println("### I/O Initialize."); | |
Wio.Init(); | |
SerialUSB.println("### Power supply ON."); | |
Wio.PowerSupplyCellular(true); | |
delay(500); | |
SerialUSB.println("### Turn on or reset."); | |
if (!Wio.TurnOnOrReset()) { | |
SerialUSB.println("### ERROR! ###"); | |
return; | |
} | |
SerialUSB.println("### Connecting to \"" APN "\"."); | |
if (!Wio.Activate(APN, USERNAME, PASSWORD)) { | |
SerialUSB.println("### ERROR! ###"); | |
return; | |
} | |
SerialUSB.println("### Setup completed."); | |
} | |
void loop() { | |
delay(INTERVAL); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment