-
Notifications
You must be signed in to change notification settings - Fork 27
Tutorial (Arduino)
This tutorial will guide you on how to use Telemetry on your Arduino.
By the end of this tutorial, you will able to receive any kind of data from the Arduino, plot it in a graph, send data to the Arduino and update some variables in real-time.
If you don't know yet how to install Telemetry on Arduino, see the previous tutorial.
In a first time, we will only send some data, for instance, the value of a variable, from the Arduino.
With Telemetry, sending data is called publishing.
In your blank .ino file, import the library and instanciate it.
#include <Telemetry.h>
Telemetry TM;Initialize it. By default, Telemetry will configure the serial port (UART) a baudrate of 9600 bauds.
TM.begin(9600);
}In the loop function, let's publish a string continously.
void loop() {
TM.pub("Hello","world");
delay(1000); // wait for a second
}In this example, we have only published a string. This can be useful for sending error messages to the computer.
Note: By default, do not send strings that are longer than 128 characters, otherwise they will be truncated.
If you connect to the device with pytelemetrycli, you can run a few commands to observe the result desktop-side: todo : animated ttty gif
>: ls -s
# Will list all available ports. Take the one for Arduino
>: serial comXX
Connected to port comXX at [9600] bauds
>: ls
Hello
>: print Hello
WorldBack Wiki home
- Fast data visualization with the command line interface (todo)
- Fast prototyping remote program control with python (todo)
- Overview of the library
- Protocol description
- All the good stuff inside Telemetry
- List of supported platforms
- Good practices (Must-read !) in writing
- Frequently Asked Questions todo
- List of official examples
- List of projects using telemetry