kopia lustrzana https://github.com/dvarrel/XCTRACK_vario
master
rodzic
568d0c40e2
commit
306ce7ee7c
|
@ -3,8 +3,6 @@ VARIO XCTRACK
|
||||||
arduino nano
|
arduino nano
|
||||||
sensor ms5611
|
sensor ms5611
|
||||||
|
|
||||||
damien varrel 07/2020
|
|
||||||
|
|
||||||
Based on Arduino Vario by Benjamin PERRIN 2017 / Vari'Up
|
Based on Arduino Vario by Benjamin PERRIN 2017 / Vari'Up
|
||||||
Based on Arduino Vario by Jaros, 2012 and vario DFelix 2013
|
Based on Arduino Vario by Jaros, 2012 and vario DFelix 2013
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ SoftwareSerial BTserial(RX, TX); // RX not connected
|
||||||
#define USB_SPEED 115200 //define serial transmision speed
|
#define USB_SPEED 115200 //define serial transmision speed
|
||||||
#define BLUETOOTH_SPEED 9600 //bluetooth speed (9600 by default)
|
#define BLUETOOTH_SPEED 9600 //bluetooth speed (9600 by default)
|
||||||
#define FREQUENCY 10 // freq output in Hz
|
#define FREQUENCY 10 // freq output in Hz
|
||||||
#define USB_MODE // uncomment for usb mode
|
//#define USB_MODE // uncomment for usb mode
|
||||||
#define BLUETOOTH_MODE // uncomment for bluetooth mode
|
#define BLUETOOTH_MODE // uncomment for bluetooth mode
|
||||||
|
|
||||||
void setup() // setup() function to setup all necessary parameters before we go to endless loop() function
|
void setup() // setup() function to setup all necessary parameters before we go to endless loop() function
|
||||||
|
@ -34,23 +34,19 @@ void loop(void) {
|
||||||
+String(Pressure)
|
+String(Pressure)
|
||||||
+String(",0,9999,0,999,");
|
+String(",0,9999,0,999,");
|
||||||
|
|
||||||
unsigned int checksum_end, ai, bi; // Calculating checksum for data string
|
uint16_t checksum = 0, bi;
|
||||||
for (checksum_end = 0, ai = 0; ai < str_out.length(); ai++)
|
for (uint8_t ai = 0; ai < str_out.length(); ai++)
|
||||||
{
|
{
|
||||||
bi = (unsigned char)str_out[ai];
|
bi = (uint8_t)str_out[ai];
|
||||||
checksum_end ^= bi;
|
checksum ^= bi;
|
||||||
}
|
}
|
||||||
|
str_out = "$"+str_out+"*"+String(checksum, HEX);
|
||||||
|
|
||||||
#ifdef USB_MODE
|
#ifdef USB_MODE
|
||||||
Serial.print("$");
|
Serial.println(str_out);
|
||||||
Serial.print(str_out);
|
|
||||||
Serial.print("*");
|
|
||||||
Serial.println(checksum_end, HEX);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef BLUETOOTH_MODE
|
#ifdef BLUETOOTH_MODE
|
||||||
BTserial.print("$"); //print first sign of NMEA protocol
|
BTserial.println(str_out);
|
||||||
BTserial.print(str_out); //print data string
|
|
||||||
BTserial.print("*"); //end of protocol string
|
|
||||||
BTserial.println(checksum_end, HEX);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue