3/19/2019
Wio Tracker - GPS, BT3.0, GSM, Arduino Compatible - Seeed Wiki
http://wiki.seeedstudio.com/wio_gps_board/
19/20
It is also very easy to connect to your Bluetooth device on Wio Tracker. Open your
Arduino IDE and click on File > Examples > MC20_GPS_Traker > MC20_BlueTooth >
BT_FastConnect to open the sketch or copy the blow code.
Then change the deviceName of your Bluetooth device, Wio Tracker will connect it
automatically.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include
"MC20_Common.h"
#include
"MC20_BT.h"
// GPSTracker gpsTracker = GPSTracker();
BlueTooth bt = BlueTooth();
int
bt_state = -
1
;
char
*deviceName =
"N-612"
;
void
setup
() {
SerialUSB.begin(
115200
);
while
(!SerialUSB);
bt.Power_On();
SerialUSB.println(
"
\n\r
MC20 power On!"
);
bt.BTPowerOn();
SerialUSB.println(
"
\n\r
BT power On!"
);
while
(IDLE != (bt_state = bt.getBTState())){
SerialUSB.print(
"State: "
);
SerialUSB.println(bt_state);
delay(
1000
);
}
bt.BTFastConnect(deviceName, HFG_PROFILE);
}
void
loop
() {
/* Debug */
if
(SerialUSB.available()){
serialMC20.write(SerialUSB.read());
}
if
(serialMC20.available()){
SerialUSB.write(serialMC20.read());
}
}