-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include "IoTtweetNBIoT.h" | ||
|
||
String userid = "your-iottweet-account-id"; /*IoTtweet account user ID (6 digits, included zero pre-fix)*/ | ||
String key = "your-device-key"; /*IoTtweet registered device key in "MY IOT Garage"*/ | ||
float data0, data1, data2, data3; /*Your sending data variable.*/ | ||
String private_tweet = "Request network time"; /*Your private tweet meassage to dashboard*/ | ||
String public_tweet = "Hello IoTtweet"; /*Your public tweet message to dashboard*/ | ||
|
||
const long looptime_task1 = 5; /* Task 1 time in sec. */ | ||
|
||
unsigned long previousMillis_task1 = 0; | ||
|
||
IoTtweetNBIoT myNBiot; | ||
|
||
void setup(){ | ||
|
||
myNBiot.init(); | ||
previousMillis_task1 = millis(); | ||
|
||
} | ||
void loop(){ | ||
|
||
unsigned long currentMillis_task1 = millis(); | ||
|
||
/* Task 1 */ | ||
if (currentMillis_task1 - previousMillis_task1 >= looptime_task1*1000) | ||
{ | ||
|
||
/* Request network time */ | ||
String nt = myNBiot.getNetworkTime(); | ||
Serial.println("Network time is " + nt); | ||
|
||
previousMillis_task1 = currentMillis_task1; | ||
} | ||
|
||
} |