Skip to content

Commit

Permalink
Changed code to support printing unsigned long long variables to Serial
Browse files Browse the repository at this point in the history
  • Loading branch information
RoelKroes authored Apr 13, 2021
1 parent be57ac8 commit 76e3ed4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
16 changes: 16 additions & 0 deletions GPS.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions WSPR_beacon_arduino.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 76e3ed4

Please sign in to comment.