Skip to content

Instantly share code, notes, and snippets.

@KazuyukiEguchi
Last active May 7, 2018 01:06
Show Gist options
  • Save KazuyukiEguchi/9556441a6a92a9f4fe562a41192768b7 to your computer and use it in GitHub Desktop.
Save KazuyukiEguchi/9556441a6a92a9f4fe562a41192768b7 to your computer and use it in GitHub Desktop.
--- 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.
--- 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.
#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