Hardware components | ||||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
Software apps and online services | ||||||
| ||||||
| ||||||
Hand tools and fabrication machines | ||||||
| ||||||
| ||||||
|
My project is about telemetry for rc planes, in aeromodelism it's important to know some flight parameters like battery level or fuel level, height of te flight, speed o plane and much more.
When you flight a plane you can't look in the same time a screen with parameters and where is the plane (if you can make that, you are a cameleon) and you must don't stop looking at the plane or the plane go quickly to the ground and it is destroyed.
Some radio manufacturers offer voice telemetry on their transmitter, but these are top of the range models and very expensive.
For this reason I thought of making a voice telemetry which is compatible with the different brands, low cost and completely independent of the manufacturers (each brand has its communication protocol, SBUS, iBus etc.., so difficult to make a universal model).
I had already made prototypes with LILYGO TTGO LORA 868Mhz ESP32 and so I chose this card.
_long distance transmission (more than 500 meters in open field)
_ important memory (32Mo)
- a lot of numbers of connection ports with integrated screen
- wifi and bluetooth
- low weight and integrated battery
- small dimension and small weight (85 grams for the transmitter with battery)
The android smartphone application was developed with MIT APP INVENTOR 2, which allowed me to easily integrate voice alarms and voice requests.
For the moment the voice alarms are:
_ Battery (threshold set according to the type of battery 3S, 4S etc.)
_Height of the plane (fixed at the start)
_ Flight time (fixed at departure)
The triggering of the start of the countdown for the flight time is either vocal or automatic according to the height / speed
here is the alarm screen
On the main screen the flight parameters are all displayed as well as a map of the plane's trajectory in real time.
The voice interrogations are for the moment:
_Battery voltage
_height o te plane
_ Speed
_flight time
Other interrogations and alarms will be added depending on the added sensors (variometer, air speed with pitot tube, gyroscope, etc.)
The flight data are recorded on the smartphone for later use (trajectory plotting in google earth, speed variation, battery voltage, etc.)
comparison with GPS Canmore GT730FL
Some video with test in flight
and with voice interrogations
thank's for reading and watching the videos, I hope you make it, it is very helpful for aeromodelers
Yves MORELE
Update: adding barometric sensor and variometer in the Android App with sound and vocal query
and the vario sound test in video
update screen with gauges
tutorial to display in google earth acquisition data in text format from the telemetry
A new UPDATE
a good friend from the Netherlands tested the system and the flying field being located near an airport there was a lot of radio disturbance which prevented the proper functioning of the system. he therefore added a CRC check and modified the acquisition delay with no blocking in the event of bad data for the backup. I attach Frank Reijn's files, he is a great pilot and he has several passions that I let you discover on his Youtube https://www.youtube.com/c/FrankReijn
//Libraries for LoRa
#include <SPI.h>
#include <LoRa.h>
#include <TinyGPS++.h>
TinyGPSPlus gps;
//Libraries for OLED Display
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <HardwareSerial.h>
HardwareSerial GPSSerial(1);
//define the pins used by the LoRa transceiver module
#define SCK 5
#define MISO 19
#define MOSI 27
#define SS 18
#define RST 14
#define DIO0 26
#define dP = 34;
#define GPS_TX 22
#define GPS_RX 23
float maxspeed = 0, speed1 = 0;
int maxhigh = 0, high1 = 0;
int maxsatelite = 0, satelite1 = 0;
int sensorValue = 0;
float meters ;
#define BAND 866E6
//OLED pins
#define OLED_SDA 4
#define OLED_SCL 15
#define OLED_RST 16
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
//packet counter
int counter = 0;
const int potPin = 34;
double Vout;
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RST);
void setup() {
GPSSerial.begin(9600, SERIAL_8N1, 22, 23);
//reset OLED display via software
pinMode(OLED_RST, OUTPUT);
digitalWrite(OLED_RST, LOW);
delay(20);
digitalWrite(OLED_RST, HIGH);
//initialize OLED
Wire.begin(OLED_SDA, OLED_SCL);
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3c, false, false)) { // Address 0x3C for 128x32
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(0,0);
display.print("LORA SENDER ");
display.display();
//initialize Serial Monitor
Serial.begin(9600);
//SPI LoRa pins
SPI.begin(SCK, MISO, MOSI, SS);
//setup LoRa transceiver module
LoRa.setPins(SS, RST, DIO0);
if (!LoRa.begin(BAND)) {
// Serial.println("Starting LoRa failed!");
while (1);
}
display.setCursor(0,10);
display.print("LoRa Initializing OK!");
display.display();
delay(2000);
}
void loop() {
Vout = float(((analogRead(potPin))*(5/4095.00)*8.4803-0.0894)*0.7167143);
updateValues();
//Send LoRa packet to receiver
LoRa.beginPacket();
LoRa.print("#"+(String(gps.time.hour()+1)+(":")+(gps.time.minute())+(":")+(gps.time.second())+","+String(gps.location.lat(), 6)+","+String(gps.location.lng(), 6)+(",")+String(gps.altitude.meters(),0)+(",")+String(speed1)));
LoRa.print(",");
LoRa.print(Vout);
LoRa.print(",");
LoRa.print(counter);
LoRa.endPacket();
display.clearDisplay();
display.setCursor(0,0);
display.print("Voltage Batt : ");
display.print(Vout);
display.setCursor(0,9);
display.print("alitude : ");
display.print(gps.altitude.meters());
display.setCursor(0,18);
display.print("latitude : ");
display.print(gps.location.lat() );
display.setCursor(0,27);
display.print("longitude : ");
display.print(gps.location.lng());
display.setCursor(0,36);
display.print("vitesse : ");
display.print(speed1 );
display.setCursor(0,45);
display.print("Heure : ");
display.print(String(gps.time.hour()+1)+(":")+(gps.time.minute())+(":")+(gps.time.second()) );
display.setCursor(0,54);
display.print("Date : ");
display.print(String(gps.date.day())+("/")+(gps.date.month())+("/")+(gps.date.year()) );
display.display();
counter++;
delay(100);
}
void updateValues()
{
while (GPSSerial.available() > 0){
int data = GPSSerial.read();
if (gps.encode(data))
{
//Serial.println(GPSSerial.read());
//Serial.println(gps.encode(GPSSerial.read()));
gps.encode(GPSSerial.read());
Serial.write(GPSSerial.read());
float meters = (gps.altitude.meters());
int airSpeed =( gps.speed.kmph());
speed1 = (gps.speed.kmph());
//if ( speed1 > maxspeed) {
// maxspeed = speed1;
//}
String Temps=String(gps.time.hour()+1)+(":")+(gps.time.minute())+(":")+(gps.time.second());
String Date=String(gps.date.day())+("/")+(gps.date.month())+("/")+(gps.date.year());
}
}
}
//Librairies pour LoRa
#include <SPI.h>
#include <LoRa.h>
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif
BluetoothSerial SerialBT;
//Librairies pour ecran OLED
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
//definition des pins utiliss par l'emetteur LoRa
#define SCK 5
#define MISO 19
#define MOSI 27
#define SS 18
#define RST 14
#define DIO0 26
//433E6 pour Asie
//866E6 pour Europe
//915E6 pour Amerique du nord
#define BAND 866E6
// pins ecran OLED
#define OLED_SDA 4
#define OLED_SCL 15
#define OLED_RST 16
#define SCREEN_WIDTH 128 // largeur OLED , en pixels
#define SCREEN_HEIGHT 64 // hauteur OLED , en pixels
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RST);
String LoRaData;
void setup() {
//reset OLED display
pinMode(OLED_RST, OUTPUT);
digitalWrite(OLED_RST, LOW);
delay(20);
digitalWrite(OLED_RST, HIGH);
//initialize OLED
Wire.begin(OLED_SDA, OLED_SCL);
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3c, false, false)) { // Address 0x3C for 128x32
Serial.println(F("SSD1306 allocation mauvaise"));
for(;;); // boucle en permanence
}
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(0,0);
display.print("LORA RECEIVER ");
display.display();
//initialize Serial Monitor
Serial.begin(115200);
SerialBT.begin("ESP32test"); // nom du peripherique Bluetooth
Serial.println("LoRa Receiver Test");
//SPI LoRa pins
SPI.begin(SCK, MISO, MOSI, SS);
//setup LoRa transceiver module
LoRa.setPins(SS, RST, DIO0);
if (!LoRa.begin(BAND)) {
Serial.println("Starting LoRa failed!");
while (1);
}
Serial.println("LoRa Initializing OK!");
display.setCursor(0,10);
display.println("LoRa Initializing OK!");
display.display();
}
void loop() {
//essai analyse pauet reu
int packetSize = LoRa.parsePacket();
if (packetSize) {
//reception paquet
Serial.print("Received packet ");
//lecture paquet
while (LoRa.available()) {
LoRaData = LoRa.readString();
}
// deinition RSSI
int rssi = LoRa.packetRssi();
// SerialBT.println(LoRa.packetRssi());
// lecture donnes reues
String readString = (LoRaData);
// divise la chaine lue par un delimiteur predefini qui est la virgule
int delimiter, delimiter_1, delimiter_2, delimiter_3 , delimiter_4, delimiter_5, delimiter_6 ;
delimiter = readString.indexOf("#");
delimiter_1 = readString.indexOf(",", delimiter + 1);
delimiter_2 = readString.indexOf(",", delimiter_1 +1);
delimiter_3 = readString.indexOf(",", delimiter_2 +1);
delimiter_4 = readString.indexOf(",", delimiter_3 +1);
delimiter_5 = readString.indexOf(",", delimiter_4 +1);
delimiter_6 = readString.indexOf(",", delimiter_5 +1);
// definition des noms de variables avec les delimiteurs pour les sous chaines
String heure = readString.substring(delimiter + 1, delimiter_1);
String latitude = readString.substring(delimiter_1 + 1, delimiter_2);
String longitude = readString.substring(delimiter_2 + 1, delimiter_3);
String altitude1 = readString.substring(delimiter_3 + 1, delimiter_4);
String vitesse = readString.substring(delimiter_4 + 1, delimiter_5);
String voltage = readString.substring(delimiter_5 + 1, delimiter_6);
String RSSI = String(rssi);
display.clearDisplay();
display.setCursor(0,0);
display.print("Heure ");
display.print(heure);
SerialBT.println("Heure="+ String(heure)+"="+"Latitude="+String(latitude)+"="+"Longitude="+String(longitude)+"="+"Altitude="+String(altitude1)+"="+"vitesse="+String(vitesse)+"="+"VoltageBatt="+String(voltage)+"="+"RSSI="+String(RSSI));
delay(500);
display.setCursor(0,10);
display.print("Latitude = ");
display.print(latitude);
display.setCursor(0,20);
display.print("Longitude : ");
display.print(longitude);
display.setCursor(0,30);
display.print("Altitude : ");
display.print(altitude1);
display.setCursor(0,40);
display.print("vitesse : ");
display.print(vitesse);
display.setCursor(0,50);
display.print("Voltage Batt : ");
display.print(voltage);
display.setCursor(0,60);
display.print("RSSI : ");
display.print(rssi);
display.display();
delay(500);
}
}
No preview (download only).
//Libraries for LoRa
#include <SPI.h>
#include <LoRa.h>
#include <TinyGPS++.h>
TinyGPSPlus gps;
//Libraries for OLED Display
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_BMP280.h>
Adafruit_BMP280 bmp; // I2C
#include <HardwareSerial.h>
HardwareSerial GPSSerial(1);
//define the pins used by the LoRa transceiver module
#define SCK 5
#define MISO 19
#define MOSI 27
#define SS 18
#define RST 14
#define DIO0 26
#define dP = 34;
#define GPS_TX 2
#define GPS_RX 23
// CODE FROM ANDREI's Project https://www.instructables.com/id/DIY-Arduino-Variometer-for-Paragliding
float vario = 0;
byte samples = 40;
byte maxsamples = 50;
float alt[51];
float tim[51];
float tempo = millis(); // Beschreibung einer Tempovariablen vom Typ float und Zuweisung eines Wertes mit der Funktion millis () - Zhlt die Zeit ab Programmstart in Millisekunden
float N1 = 0; // Variable zur Mittelwertbildung
float N2 = 0; // Variable zur Mittelwertbildung
float N3 = 0; // Variable zur Mittelwertbildung
float D1 = 0; // Variable zur Mittelwertbildung
float D2 = 0; // Variable zur Mittelwertbildung
float maxspeed = 0, speed1 = 0;
int maxhigh = 0, high1 = 0;
int maxsatelite = 0, satelite1 = 0;
float altitude0BMP280=0;
float GPS_Distance;
int sensorValue = 0;
float meters ;
float metersbmp280 ;
float temperaturebmp280 ;
#define BAND 866E6
//OLED pins
#define BMP_SDA 21
#define BMP_SCL 22
#define OLED_SDA 4
#define OLED_SCL 15
#define OLED_RST 16
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
//packet counter
int counter = 0;
const int potPin = 34;
double Vout;
int Time_GPS_seconds;
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RST);
void setup() {
GPSSerial.begin(9600, SERIAL_8N1, 23, 2);
if (!bmp.begin(0x76)) {
Serial.println(F("Could not find a valid BMP280 sensor, check wiring!"));
while (1);
}
//reset OLED display via software
pinMode(OLED_RST, OUTPUT);
digitalWrite(OLED_RST, LOW);
delay(20);
digitalWrite(OLED_RST, HIGH);
/* Default settings from datasheet. */
bmp.setSampling(Adafruit_BMP280::MODE_NORMAL, /* Operating Mode. */
Adafruit_BMP280::SAMPLING_X2, /* Temp. oversampling */
Adafruit_BMP280::SAMPLING_X16, /* Pressure oversampling */
Adafruit_BMP280::FILTER_X16, /* Filtering. */
Adafruit_BMP280::STANDBY_MS_500); /* Standby time. */
altitude0BMP280=(bmp.readAltitude(1023.5));
//initialize OLED
Wire.begin(OLED_SDA, OLED_SCL);
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3c, false, false)) { // Address 0x3C for 128x32
Serial.println(F("SSD1306 allocation failed"));
for(;;); // Don't proceed, loop forever
}
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(0,0);
display.print("LORA SENDER ");
display.display();
//initialize Serial Monitor
Serial.begin(9600);
//SPI LoRa pins
SPI.begin(SCK, MISO, MOSI, SS);
//setup LoRa transceiver module
LoRa.setPins(SS, RST, DIO0);
if (!LoRa.begin(BAND)) {
// Serial.println("Starting LoRa failed!");
while (1);
}
display.setCursor(0,10);
display.print("LoRa Initializing OK!");
display.display();
delay(2000);
}
void loop() {
Wire.begin(BMP_SDA, BMP_SCL);
bmp280();
Vout = float(((analogRead(potPin))*(5/4095.00)*8.4803-0.0894)*0.7167143);
Serial.print(F("Temperature = "));
Serial.print(bmp.readTemperature());
Serial.println(" *C");
Serial.print(F("Pressure = "));
Serial.print(bmp.readPressure());
Serial.println(" Pa");
Serial.print(F("Approx altitude = "));
Serial.print(bmp.readAltitude(1030)); /* Adjusted to local forecast! */
Serial.println(" m");
updateValues();
VarioMSCalculation();
//Send LoRa packet to receiver
LoRa.beginPacket();
LoRa.print("#"+(String(gps.time.hour()+2)+(":")+(gps.time.minute())+(":")+(gps.time.second())+","+String(gps.location.lat(), 6)+","+String(gps.location.lng(), 6)+(",")+String(gps.altitude.meters(),0)+(",")+String(gps.speed.kmph())));
LoRa.print(",");
LoRa.print(Vout);
LoRa.print(",");
LoRa.print((metersbmp280-altitude0BMP280),1 );
LoRa.print(",");
LoRa.print(temperaturebmp280,0 );
LoRa.print(",");
LoRa.print(vario);
LoRa.print(",");
LoRa.print(GPS_Distance);
LoRa.print(",");
LoRa.print(String(Time_GPS_seconds));
LoRa.print(",");
LoRa.print(counter);
LoRa.endPacket();
Wire.begin(OLED_SDA, OLED_SCL);
display.clearDisplay();
display.setCursor(0,0);
display.print("Vbat:");
display.print(Vout);
display.print(" Alt:");
display.print(gps.altitude.meters(),0);
display.setCursor(0,9);
display.print("lat : ");
display.print(gps.location.lat(),4 );
display.setCursor(0,18);
display.print(" long : ");
display.print(gps.location.lng(),4);
display.setCursor(0,27);
display.print("Vitesse: ");
display.print((gps.speed.kmph()) );
display.setCursor(0,36);
display.print("Heure : ");
display.print(String(gps.time.hour()+2)+(":")+(gps.time.minute())+(":")+(gps.time.second()) );
display.setCursor(0,45);
display.print("Vario : ");
display.print (vario);
display.print(" m/s ");
display.setCursor(0,54);
display.print("Hbmp:");
display.print((metersbmp280-altitude0BMP280),1 );
display.print(" Tbmp:");
display.print(temperaturebmp280,0 );
display.display();
counter++;
delay(100);
}
void updateValues()
{
while (GPSSerial.available() > 0){
int data = GPSSerial.read();
Serial.println(data);
if (gps.encode(data))
{
float Starting_Latitude = 0;
float Starting_Longitude = 0;
gps.encode(GPSSerial.read());
Serial.write(GPSSerial.read());
float meters = (gps.altitude.meters());
int airSpeed =( gps.speed.kmph());
if ( gps.location.lat() > 0.0 and gps.location.lng() > 0.0)
{
Starting_Longitude = gps.location.lng();
Starting_Latitude = gps.location.lat();
}
GPS_Distance = (gps.distanceBetween( gps.location.lat(), gps.location.lng(), Starting_Latitude, Starting_Longitude)) ;
speed1 = (gps.speed.kmph(),0);
String Temps=String(gps.time.hour()+2)+(":")+(gps.time.minute())+(":")+(gps.time.second());
String Date=String(gps.date.day())+("/")+(gps.date.month())+("/")+(gps.date.year());
Time_GPS_seconds=((gps.time.hour()+2)*3600)+((gps.time.minute())*60)+(gps.time.second());
}
}
}
void bmp280()
{
metersbmp280=(bmp.readAltitude(1023.5));
temperaturebmp280=(bmp.readTemperature());
}
// Variofunktion FROM ANDREI's Project https://www.instructables.com/id/DIY-Arduino-Variometer-for-Paragliding
void VarioMSCalculation(){
tempo = millis(); // Beschreibung einer Tempovariablen vom Typ float und Zuweisung eines Wertes mit der Funktion millis () - Zhlt die Zeit ab Programmstart in Millisekunden
N1 = 0; // Variable zur Mittelwertbildung
N2 = 0; // Variable zur Mittelwertbildung
N3 = 0; // Variable zur Mittelwertbildung
D1 = 0; // Variable zur Mittelwertbildung
D2 = 0; // Variable zur Mittelwertbildung
////// ZERO VARIO /////
vario = 0;
for(int cc=1; cc<=maxsamples; cc++) // Averager
{ //
alt[(cc-1)] = alt[cc]; // http://www.instructables.com/id/GoFly-paraglidinghanglidinggliding-altimeter-v/?ALLSTEPS
tim[(cc-1)] = tim[cc]; // http://redhats.ru/variometer-arduino-2015/
} //
//
alt[maxsamples] = bmp.readAltitude(); //
tim[maxsamples] = tempo; //
float stime = tim[maxsamples-samples]; //
//
for(int cc=(maxsamples-samples); cc<maxsamples; cc++) //
{ //
N1+=(tim[cc]-stime)*alt[cc]; //
N2+=(tim[cc]-stime); //
N3+=(alt[cc]); //
D1+=(tim[cc]-stime)*(tim[cc]-stime); //
D2+=(tim[cc]-stime); //
} // Durchschnittliches Krperende
/////VARIO VALUES CALCULATING /////
vario=1000*((samples*N1)-N2*N3)/(samples*D1-D2*D2); // BERECHNUNG VON VARIOMETERWERTEN
}
//Librairies pour LoRa
#include <SPI.h>
#include <LoRa.h>
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif
BluetoothSerial SerialBT;
//Librairies pour ecran OLED
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
//definition des pins utiliss par l'emetteur LoRa
#define SCK 5
#define MISO 19
#define MOSI 27
#define SS 18
#define RST 14
#define DIO0 26
//433E6 pour Asie
//866E6 pour Europe
//915E6 pour Amerique du nord
#define BAND 866E6
// pins ecran OLED
#define OLED_SDA 4
#define OLED_SCL 15
#define OLED_RST 16
#define SCREEN_WIDTH 128 // largeur OLED , en pixels
#define SCREEN_HEIGHT 64 // hauteur OLED , en pixels
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RST);
String LoRaData;
void setup() {
//reset OLED display
pinMode(OLED_RST, OUTPUT);
digitalWrite(OLED_RST, LOW);
delay(20);
digitalWrite(OLED_RST, HIGH);
//initialize OLED
Wire.begin(OLED_SDA, OLED_SCL);
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3c, false, false)) { // Address 0x3C for 128x32
Serial.println(F("SSD1306 allocation mauvaise"));
for(;;); // boucle en permanence
}
display.clearDisplay();
display.setTextColor(WHITE);
display.setTextSize(1);
display.setCursor(0,0);
display.print("LORA RECEIVER ");
display.display();
//initialize Serial Monitor
Serial.begin(115200);
SerialBT.begin("ESP32test"); // nom du peripherique Bluetooth
Serial.println("LoRa Receiver Test");
//SPI LoRa pins
SPI.begin(SCK, MISO, MOSI, SS);
//setup LoRa transceiver module
LoRa.setPins(SS, RST, DIO0);
if (!LoRa.begin(BAND)) {
Serial.println("Starting LoRa failed!");
while (1);
}
Serial.println("LoRa Initializing OK!");
display.setCursor(0,10);
display.println("LoRa Initializing OK!");
display.display();
}
void loop() {
//essai analyse pauet reu
int packetSize = LoRa.parsePacket();
if (packetSize) {
//reception paquet
Serial.print("Received packet ");
//lecture paquet
while (LoRa.available()) {
LoRaData = LoRa.readString();
}
// deinition RSSI
int rssi = LoRa.packetRssi();
// SerialBT.println(LoRa.packetRssi());
// lecture donnes reues
String readString = (LoRaData);
// divise la chaine lue par un delimiteur predefini qui est la virgule
int delimiter, delimiter_1, delimiter_2, delimiter_3 , delimiter_4, delimiter_5, delimiter_6, delimiter_7, delimiter_8 , delimiter_9, delimiter_10 , delimiter_11;
delimiter = readString.indexOf("#");
delimiter_1 = readString.indexOf(",", delimiter + 1);
delimiter_2 = readString.indexOf(",", delimiter_1 +1);
delimiter_3 = readString.indexOf(",", delimiter_2 +1);
delimiter_4 = readString.indexOf(",", delimiter_3 +1);
delimiter_5 = readString.indexOf(",", delimiter_4 +1);
delimiter_6 = readString.indexOf(",", delimiter_5 +1);
delimiter_7 = readString.indexOf(",", delimiter_6 +1);
delimiter_8 = readString.indexOf(",", delimiter_7 +1);
delimiter_9 = readString.indexOf(",", delimiter_8 +1);
delimiter_10 = readString.indexOf(",", delimiter_9 +1);
delimiter_11 = readString.indexOf(",", delimiter_10 +1);
// definition des noms de variables avec les delimiteurs pour les sous chaines
String heure = readString.substring(delimiter + 1, delimiter_1);
String latitude = readString.substring(delimiter_1 + 1, delimiter_2);
String longitude = readString.substring(delimiter_2 + 1, delimiter_3);
String altitude1 = readString.substring(delimiter_3 + 1, delimiter_4);
String vitesse = readString.substring(delimiter_4 + 1, delimiter_5);
String voltage = readString.substring(delimiter_5 + 1, delimiter_6);
String Hbmp = readString.substring(delimiter_6 + 1, delimiter_7);
String Tbmp = readString.substring(delimiter_7 + 1, delimiter_8);
String Vario = readString.substring(delimiter_8 + 1, delimiter_9);
String Distance = readString.substring(delimiter_9 + 1, delimiter_10);
String Time_gps_seconds = readString.substring(delimiter_10 + 1, delimiter_11);
String RSSI = String(rssi);
display.clearDisplay();
display.setCursor(0,0);
display.print("Lat:");
display.print(latitude);
SerialBT.println("Heure="+ String(heure)+"="+"Latitude="+String(latitude)+"="+"Longitude="+String(longitude)+"="+"Altitude="+String(altitude1)+"="+"vitesse="+String(vitesse)+"="+"VoltageBatt="+String(voltage)+"="+"Hbmp="+String(Hbmp)+"="+"Tbmp="+String(Tbmp)+"="+"Vario="+String(Vario)+"="+"Distance="+String(Distance)+"=""Secondes="+String(Time_gps_seconds)+"="+"RSSI="+String(RSSI));
delay(500);
display.setCursor(0,10);
display.print("Long:");
display.print(longitude);
display.setCursor(0,20);
display.print("Alt:");
display.print(altitude1);
display.print(" Vgps:");
display.print(vitesse);
display.setCursor(0,30);
display.print("Hbmp :");
display.print(Hbmp);
display.setCursor(0,40);
display.print("Vario:");
display.print(Vario);
display.print(" Dist:");
display.print(Distance);
display.setCursor(0,50);
display.print("Vbat ");
display.print(voltage);
display.print(" RSSI:");
display.print(rssi);
display.display();
delay(500);
}
}
Comments