From 76e3ed45af04da6bbb3a3827cc5fbb9507596f99 Mon Sep 17 00:00:00 2001 From: RoelK <58561387+RoelKroes@users.noreply.github.com> Date: Tue, 13 Apr 2021 21:58:05 +0200 Subject: [PATCH] Changed code to support printing unsigned long long variables to Serial --- GPS.ino | 16 ++++++++++++++++ WSPR_beacon_arduino.ino | 4 ++-- settings.h | 3 ++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/GPS.ino b/GPS.ino index c88890c..1401b89 100644 --- a/GPS.ino +++ b/GPS.ino @@ -39,6 +39,22 @@ void BlinkLED(unsigned int nr, unsigned int ms) } } +/*********************************************************************************************************************************/ +// Print an unsigned long long to Serial output +void printull(unsigned long long ull) +{ + char buf[16]; + if(ull > 0xFFFFFFFFLL) + { + sprintf(buf, "%lu%08lu", (unsigned long)(ull>>32), (unsigned long)(ull&0xFFFFFFFFULL)); + } + else + { + sprintf(buf, "%lu", (unsigned long)ull); + } + Serial.println( buf ); +} + /*********************************************************************************************************************************/ // Process all data from the GPS and check the GPS time to see if we need to start send WSPR diff --git a/WSPR_beacon_arduino.ino b/WSPR_beacon_arduino.ino index 583adcb..696301b 100644 --- a/WSPR_beacon_arduino.ino +++ b/WSPR_beacon_arduino.ino @@ -17,7 +17,7 @@ TinyGPSPlus gps; #define MAX_TX_LEN WSPR_SYMBOL_COUNT // Global variables -unsigned long freq; +unsigned long long freq; uint8_t tx_buffer[255]; uint8_t symbol_count; uint16_t tone_delay, tone_spacing; @@ -229,7 +229,7 @@ void loop() { // Encode and TX #if defined(DEVMODE) - Serial.print(F("TX..")); Serial.print(F("Frequency: ")); Serial.println(freq); + Serial.print(F("TX..")); Serial.print(F("Frequency: ")); printull(freq); #endif encode(); diff --git a/settings.h b/settings.h index 2f2b2b3..a46399e 100644 --- a/settings.h +++ b/settings.h @@ -9,6 +9,7 @@ // Your own HAM call. Change it #define MYCALL "MYCALL" + // The power of your transmission in dBm. // for the si5351 this should be set to 10 (=10 milliwatts). #define DBMPOWER 10 @@ -38,7 +39,7 @@ * It won't work if you don't calibrate your si5351 ************************************************************************************/ // Change this value! -#define SI5351_CORRECTION 50000 +#define SI5351_CORRECTION 11000 /*********************************************************************************** * wspr SETTINGS