3/19/2019
Wio Tracker - GPS, BT3.0, GSM, Arduino Compatible - Seeed Wiki
http://wiki.seeedstudio.com/wio_gps_board/
13/20
Use Grove modules to expand your application
To use 6 Grove connectors on Wio Tracker, we have to use
to open 3V3_B to power the Grove modules(D12 defaults to LOW in order to
reduce consumption).
The following code shows how to use Analog and Digital Grove modules:
Open your Arduino IDE and click on File > Examples > MC20_GPS_Traker >
Button_LightSensor to open the sketch or copy the blow code:
12
13
14
15
16
17
float
v = a/
1023.0
*
3.3
*
2.0
;
// there's an 10M and 10M re
SerialUSB.print(
"The voltage of battery is "
);
SerialUSB.print(v,
2
);
SerialUSB.println(
" V"
);
delay(
1000
);
}
digitalWrite(12,
HIGH)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include
"MC20_Arduino_Interface.h"
#define GrovePowerPin 12
#define LightSensorPin A0
#define ButtonPin 2
void
setup
() {
SerialUSB.begin(
115200
);
pinMode(ButtonPin, INPUT);
pinMode(GrovePowerPin, OUTPUT);
// write high to grove power pin to enable all the Grove ports,
// or only Grove D2 port is usable.
digitalWrite(GrovePowerPin, HIGH);
}
void
loop
() {
// print analog data when the button is pressed
if
(digitalRead(ButtonPin)) {
SerialUSB.print(
"The value of light sensor:"
);
SerialUSB.println(analogRead(LightSensorPin));
}