Development Tutorial
Before start the development, please check Setup your toolchain to set up the tool first.
Hardware overview
Firmware overview
Grove
There are 6 Grove interfaces in the Wio Tracker 1110 Dev Board, which can be connected to 300+ Grove modules. Click here to know more about the Grove module.
Grove I2C
There is a Grove I2C port on the DK, with SDA
on pin 27 and SCL
on pin 26.
Grove UART
The Wio Tracker 1110 Dev Board has two UART peripherals, namely uart0
and uart1
. uart0
pins are connected to the CH340C for debugging purposes, while uart1
serves as a Grove UART Port.
Referring to the schematic, TXD is located on pin 8 and RXD is on pin 6.
#define LED1 13
#define LED2 14
#define TXD 8
#define RXD 6
#define UART_TX_RX_BUF_SIZE 256
Grove Digital
#include <Adafruit_TinyUSB.h>
#include <Wire.h>
#include <Ultrasonic.h>
// Define the pin to which the ultrasonic sensor is connected
constexpr int ULTRASONIC_PIN = D0;
Ultrasonic ultrasonic(ULTRASONIC_PIN);
void setup()
{
delay(100);
Serial.begin(115200); // Start Serial communication at a baud rate of 115200
while (!Serial) delay(100);
void loop()
{
long RangeInInches; // Variable to store distance in inches
long RangeInCentimeters; // Variable to store distance in centimeters
Serial.println("The distance to obstacles in front is: ");
RangeInInches = ultrasonic.MeasureInInches(); // Measure distance in inches using the Ultrasonic sensor
Serial.print(RangeInInches);
Serial.println(" inch");
delay(250);
RangeInCentimeters = ultrasonic.MeasureInCentimeters();
Serial.print(RangeInCentimeters);
Serial.println(" cm");
delay(2500);
}
Grove Analog
Example Code:
#include <Adafruit_TinyUSB.h> // for Serial
constexpr int ADCIN = A0;
constexpr float MV_PER_LSB = 3600.0f / 1024.0f; // 10-bit ADC with 3.6V input range
void setup()
{
delay(100);
Serial.begin(115200);
while (!Serial) delay(100);
}
void loop()
{
// Get a fresh ADC value
long sum = 0;
for (int i = 0; i < 32; i++)
{
sum += analogRead(ADCIN);
}
int adcvalue = sum / 32;
// Display the results
Serial.print(adcvalue);
Serial.print(" [");
Serial.print((float)adcvalue * MV_PER_LSB);
Serial.println(" mV]");
delay(1000);
}