Skip to content

Commit

Permalink
Merge pull request #278 from blinker-iot/dev_2.0
Browse files Browse the repository at this point in the history
update codes, upgrade BLINKER WIF & MQTT codes
  • Loading branch information
i3water authored Dec 16, 2018
2 parents 8dd2284 + b71e2af commit dc8fc08
Show file tree
Hide file tree
Showing 46 changed files with 617 additions and 1,039 deletions.
3 changes: 2 additions & 1 deletion examples/Blinker_AHRS/AHRS_WiFi/AHRS_WiFi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

#include <Blinker.h>

char auth[] = "Your Device Secret Key";
char ssid[] = "Your WiFi network SSID or name";
char pswd[] = "Your WiFi network WPA password or WEP key";

Expand All @@ -55,7 +56,7 @@ void setup()
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);

Blinker.begin(ssid, pswd);
Blinker.begin(auth, ssid, pswd);
Blinker.attachData(dataRead);
Blinker.attachAhrs();
}
Expand Down
4 changes: 3 additions & 1 deletion examples/Blinker_APCONFIG/APCONFIG_WiFi/APCONFIG_WiFi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

#include <Blinker.h>

char auth[] = "Your Device Secret Key";

void dataRead(const String & data)
{
BLINKER_LOG("Blinker readString: ", data);
Expand All @@ -53,7 +55,7 @@ void setup()
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);

Blinker.begin();
Blinker.begin(auth);
Blinker.attachData(dataRead);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,71 +1,71 @@
/* *****************************************************************
*
* Download latest Blinker library here:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
*
* Blinker is a platform with iOS and Android apps to
* control embedded hardware like Arduino, Raspberrt Pi.
* You can easily build graphic interfaces for all your
* projects by simply dragging and dropping widgets.
*
* Docs: https://doc.blinker.app/
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************
*
* Blinker 库下载地址:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
* Blinker 是一个运行在 IOS 和 Android 上用于控制嵌入式硬件的应用程序。
* 你可以通过拖放控制组件,轻松地为你的项目建立图形化控制界面。
*
* 文档: https://doc.blinker.app/
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************/

#define BLINKER_PRINT Serial
#define BLINKER_MQTT

#include <Blinker.h>

char auth[] = "Your MQTT Secret Key";
char ssid[] = "Your WiFi network SSID or name";
char pswd[] = "Your WiFi network WPA password or WEP key";

void dataRead(const String & data)
{
BLINKER_LOG("Blinker readString: ", data);

uint32_t BlinkerTime = millis();

Blinker.vibrate();
Blinker.print("millis", BlinkerTime);

digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
String get_aqi = Blinker.aqi();
BLINKER_LOG("AQI: ", get_aqi);

Blinker.delay(60000);
}

void setup()
{
Serial.begin(115200);

#if defined(BLINKER_PRINT)
BLINKER_DEBUG.stream(BLINKER_PRINT);
#endif

pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);

Blinker.begin(auth, ssid, pswd);
Blinker.attachData(dataRead);
}

void loop()
{
Blinker.run();
/* *****************************************************************
*
* Download latest Blinker library here:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
*
* Blinker is a platform with iOS and Android apps to
* control embedded hardware like Arduino, Raspberrt Pi.
* You can easily build graphic interfaces for all your
* projects by simply dragging and dropping widgets.
*
* Docs: https://doc.blinker.app/
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************
*
* Blinker 库下载地址:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
* Blinker 是一个运行在 IOS 和 Android 上用于控制嵌入式硬件的应用程序。
* 你可以通过拖放控制组件,轻松地为你的项目建立图形化控制界面。
*
* 文档: https://doc.blinker.app/
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************/

#define BLINKER_PRINT Serial
#define BLINKER_WIFI

#include <Blinker.h>

char auth[] = "Your Device Secret Key";
char ssid[] = "Your WiFi network SSID or name";
char pswd[] = "Your WiFi network WPA password or WEP key";

void dataRead(const String & data)
{
BLINKER_LOG("Blinker readString: ", data);

uint32_t BlinkerTime = millis();

Blinker.vibrate();
Blinker.print("millis", BlinkerTime);

digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
String get_aqi = Blinker.aqi();
BLINKER_LOG("AQI: ", get_aqi);

Blinker.delay(60000);
}

void setup()
{
Serial.begin(115200);

#if defined(BLINKER_PRINT)
BLINKER_DEBUG.stream(BLINKER_PRINT);
#endif

pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);

Blinker.begin(auth, ssid, pswd);
Blinker.attachData(dataRead);
}

void loop()
{
Blinker.run();
}
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
/* *****************************************************************
*
* Download latest Blinker library here:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
*
* Blinker is a platform with iOS and Android apps to
* control embedded hardware like Arduino, Raspberrt Pi.
* You can easily build graphic interfaces for all your
* projects by simply dragging and dropping widgets.
*
* Docs: https://doc.blinker.app/
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************
*
* Blinker 库下载地址:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
* Blinker 是一个运行在 IOS 和 Android 上用于控制嵌入式硬件的应用程序。
* 你可以通过拖放控制组件,轻松地为你的项目建立图形化控制界面。
*
* 文档: https://doc.blinker.app/
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************/

/*
*
* This example not complete at all, TODO.
*
* /
// #define BLINKER_PRINT Serial
// #define BLINKER_MQTT
// #include <Blinker.h>
// char auth[] = "Your MQTT Secret Key";
// char ssid[] = "Your WiFi network SSID or name";
// char pswd[] = "Your WiFi network WPA password or WEP key";
// #define BUTTON_1 "ButtonKey"
// void setup() {
// Serial.begin(115200);
// pinMode(LED_BUILTIN, OUTPUT);
// digitalWrite(LED_BUILTIN, LOW);
// Blinker.begin(auth, ssid, pswd);
// Blinker.beginAuto();
// Blinker.wInit(BUTTON_1, W_BUTTON);
// }
// void loop()
// {
// Blinker.run();
// if (Blinker.available()) {
// BLINKER_LOG("Blinker readString: ", data);
// uint32_t BlinkerTime = millis();
// Blinker.beginFormat();
// Blinker.vibrate();
// Blinker.print("millis", BlinkerTime);
// Blinker.endFormat();
// }
// if (Blinker.button(BUTTON_1)) {
// digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
// }
// Blinker.autoInput("key", "value");
// Blinker.autoRun();
// Blinker.delay(1000);
/* *****************************************************************
*
* Download latest Blinker library here:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
*
* Blinker is a platform with iOS and Android apps to
* control embedded hardware like Arduino, Raspberrt Pi.
* You can easily build graphic interfaces for all your
* projects by simply dragging and dropping widgets.
*
* Docs: https://doc.blinker.app/
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************
*
* Blinker 库下载地址:
* https://github.com/blinker-iot/blinker-library/archive/master.zip
*
* Blinker 是一个运行在 IOS 和 Android 上用于控制嵌入式硬件的应用程序。
* 你可以通过拖放控制组件,轻松地为你的项目建立图形化控制界面。
*
* 文档: https://doc.blinker.app/
* https://github.com/blinker-iot/blinker-doc/wiki
*
* *****************************************************************/

/*
*
* This example not complete at all, TODO.
*
* /
// #define BLINKER_PRINT Serial
// #define BLINKER_MQTT
// #include <Blinker.h>
// char auth[] = "Your Device Secret Key";
// char ssid[] = "Your WiFi network SSID or name";
// char pswd[] = "Your WiFi network WPA password or WEP key";
// #define BUTTON_1 "ButtonKey"
// void setup() {
// Serial.begin(115200);
// pinMode(LED_BUILTIN, OUTPUT);
// digitalWrite(LED_BUILTIN, LOW);
// Blinker.begin(auth, ssid, pswd);
// Blinker.beginAuto();
// Blinker.wInit(BUTTON_1, W_BUTTON);
// }
// void loop()
// {
// Blinker.run();
// if (Blinker.available()) {
// BLINKER_LOG("Blinker readString: ", data);
// uint32_t BlinkerTime = millis();
// Blinker.beginFormat();
// Blinker.vibrate();
// Blinker.print("millis", BlinkerTime);
// Blinker.endFormat();
// }
// if (Blinker.button(BUTTON_1)) {
// digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
// }
// Blinker.autoInput("key", "value");
// Blinker.autoRun();
// Blinker.delay(1000);
// }
4 changes: 2 additions & 2 deletions examples/Blinker_AliGenie/AliGenie_LIGHT/AliGenie_LIGHT.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
* *****************************************************************/

#define BLINKER_PRINT Serial
#define BLINKER_MQTT
#define BLINKER_WIFI
#define BLINKER_ALIGENIE_LIGHT

#include <Blinker.h>

char auth[] = "Your MQTT Secret Key";
char auth[] = "Your Device Secret Key";
char ssid[] = "Your WiFi network SSID or name";
char pswd[] = "Your WiFi network WPA password or WEP key";

Expand Down
4 changes: 2 additions & 2 deletions examples/Blinker_AliGenie/AliGenie_OUTLET/AliGenie_OUTLET.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
* *****************************************************************/

#define BLINKER_PRINT Serial
#define BLINKER_MQTT
#define BLINKER_WIFI
#define BLINKER_ALIGENIE_OUTLET

#include <Blinker.h>

char auth[] = "Your MQTT Secret Key";
char auth[] = "Your Device Secret Key";
char ssid[] = "Your WiFi network SSID or name";
char pswd[] = "Your WiFi network WPA password or WEP key";

Expand Down
4 changes: 2 additions & 2 deletions examples/Blinker_AliGenie/AliGenie_SENSOR/AliGenie_SENSOR.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
* *****************************************************************/

#define BLINKER_PRINT Serial
#define BLINKER_MQTT
#define BLINKER_WIFI
#define BLINKER_ALIGENIE_SENSOR

#include <Blinker.h>

char auth[] = "Your MQTT Secret Key";
char auth[] = "Your Device Secret Key";
char ssid[] = "Your WiFi network SSID or name";
char pswd[] = "Your WiFi network WPA password or WEP key";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
* *****************************************************************/

#define BLINKER_PRINT Serial
#define BLINKER_MQTT
#define BLINKER_WIFI

#include <Blinker.h>

char auth[] = "Your MQTT Secret Key";
char auth[] = "Your Device Secret Key";
char ssid[] = "Your WiFi network SSID or name";
char pswd[] = "Your WiFi network WPA password or WEP key";

Expand Down
Loading

0 comments on commit dc8fc08

Please sign in to comment.