Skip to content

Commit 88f3d1f

Browse files
committed
update example & readme
1 parent 7be5925 commit 88f3d1f

File tree

17 files changed

+205
-31
lines changed

17 files changed

+205
-31
lines changed

README.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,15 @@ BLE:
4141
void setup() {
4242
Blinker.begin();
4343
}
44-
```
44+
```
45+
46+
>SerialBLE Modules:
47+
>**Blinker.begin()** will config SoftWareSerial with default settings.
48+
>
49+
>Blinker.begin();// default settings digital pins 2(RX) 3(TX) and baudrate 9600 bps
50+
>Blinker.begin(4, 5);// config digital pins 4(RX) 5(TX) with default baudrate 9600 bps
51+
>Blinker.begin(4, 5, 115200);// config digital pins 4(RX) 5(TX) and baudrate 115200 bps
52+
4553
WiFi:
4654
```
4755
#define BLINKER_WIFI
@@ -187,7 +195,15 @@ Blinker.begin(...);
187195
void setup() {
188196
Blinker.begin();
189197
}
190-
```
198+
```
199+
200+
>串口蓝牙模块:
201+
>**Blinker.begin()** 将使用默认设置配置 SoftWareSerial
202+
>
203+
>Blinker.begin();// 默认设置: 数字IO 2(RX) 3(TX), 波特率 9600 bps
204+
>Blinker.begin(4, 5);// 设置数字IO 4(RX) 5(TX), 默认波特率 9600 bps
205+
>Blinker.begin(4, 5, 115200);// 设置数字IO 4(RX) 5(TX) 及波特率 115200 bps
206+
191207
WiFi模块:
192208
```
193209
#define BLINKER_WIFI

examples/Blinker_AHRS/AHRS_BLE/AHRS_BLE.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define BLINKER_PRINT Serial
1+
#define BLINKER_PRINT Serial
22
#define BLINKER_BLE
33

44
#include <Blinker.h>

examples/Blinker_AHRS/AHRS_WiFi/AHRS_WiFi.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define BLINKER_PRINT Serial
1+
#define BLINKER_PRINT Serial
22
#define BLINKER_WIFI
33

44
#include <Blinker.h>

examples/Blinker_Button/Button_BLE/Button_BLE.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define BLINKER_PRINT Serial
1+
#define BLINKER_PRINT Serial
22
#define BLINKER_BLE
33

44
#define BUTTON_1 "ButtonKey"

examples/Blinker_Button/Button_WiFi/Button_WiFi.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define BLINKER_PRINT Serial
1+
#define BLINKER_PRINT Serial
22
#define BLINKER_WIFI
33

44
#define BUTTON_1 "ButtonKey"

examples/Blinker_Joystick/Joystick_BLE/Joystick_BLE.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define BLINKER_PRINT Serial
1+
#define BLINKER_PRINT Serial
22
#define BLINKER_BLE
33

44
#include <Blinker.h>

examples/Blinker_Joystick/Joystick_WiFi/Joystick_WiFi.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define BLINKER_PRINT Serial
1+
#define BLINKER_PRINT Serial
22
#define BLINKER_WIFI
33

44
#include <Blinker.h>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#define BLINKER_PRINT Serial
2+
#define BLINKER_BLE
3+
4+
#include <Blinker.h>
5+
6+
#include <modules/Ultrasonic.h>
7+
8+
Ultrasonic SR04(9,8);
9+
10+
void setup()
11+
{
12+
Serial.begin(115200);
13+
14+
pinMode(LED_BUILTIN, OUTPUT);
15+
digitalWrite(LED_BUILTIN, LOW);
16+
17+
Blinker.begin();
18+
}
19+
20+
void loop()
21+
{
22+
Blinker.run();
23+
24+
if (Blinker.available()) {
25+
BLINKER_LOG2("Blinker.readString(): ", Blinker.readString());
26+
27+
Blinker.vibrate();
28+
29+
uint32_t BlinkerTime = millis();
30+
Blinker.print(BlinkerTime);
31+
Blinker.print("millis", BlinkerTime);
32+
}
33+
34+
BLINKER_LOG3("SR04: ", SR04.Ranging(CM), " cm");
35+
36+
Blinker.print("SR04", SR04.Ranging(CM));
37+
38+
Blinker.delay(1000);
39+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#define BLINKER_PRINT Serial
2+
#define BLINKER_WIFI
3+
4+
#include <Blinker.h>
5+
6+
char ssid[] = "<Your WiFi network SSID or name>";
7+
char pswd[] = "<Your WiFi network WPA password or WEP key>";
8+
9+
#include <modules/Ultrasonic.h>
10+
11+
Ultrasonic SR04(9,8);
12+
13+
void setup()
14+
{
15+
Serial.begin(115200);
16+
17+
pinMode(LED_BUILTIN, OUTPUT);
18+
digitalWrite(LED_BUILTIN, LOW);
19+
20+
Blinker.begin(ssid, pswd);
21+
}
22+
23+
void loop()
24+
{
25+
Blinker.run();
26+
27+
if (Blinker.available()) {
28+
BLINKER_LOG2("Blinker.readString(): ", Blinker.readString());
29+
30+
Blinker.vibrate();
31+
32+
uint32_t BlinkerTime = millis();
33+
Blinker.print(BlinkerTime);
34+
Blinker.print("millis", BlinkerTime);
35+
}
36+
37+
BLINKER_LOG3("SR04: ", SR04.Ranging(CM), " cm");
38+
39+
Blinker.print("SR04", SR04.Ranging(CM));
40+
41+
Blinker.delay(1000);
42+
}

examples/Blinker_Slider/Slider_BLE/Slider_BLE.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define BLINKER_PRINT Serial
1+
#define BLINKER_PRINT Serial
22
#define BLINKER_BLE
33

44
#define SLIDER_1 "SliderKey"

0 commit comments

Comments
 (0)