Skip to content

Instantly share code, notes, and snippets.

@JDat
JDat / maidenhead.cpp
Created April 9, 2021 06:19
Calculate Maidenhed locator from lat lon. Arduino compatible.
/*
* Maps for test/validation
* http://rk1at.ru/wwwloc/qthloc.html
* https://dxcluster.ha8tks.hu/hamgeocoding/
*
* compile: g++ -o maidenhead maidenhead.cpp
* execute: ./maidenhead 56.123 17.4553
*/
#include <stdio.h> // for printf()
@JDat
JDat / geostat_sat_calc.ino
Last active March 2, 2023 16:31
Calculate geostationary satellite azimuth, elevation and tilt angles with arduino.
/*
* Calculate gostationary satellite
* azimuth, elevation and tilt angles
* with arduino.
* Input data:
* Geostationary satellite orbital position 25.8 degrees East (negative for West)
* Your GPS coordinates as decimal degrees and fraction.
* Longitude: 22.42 degrees East (negative for West)
* Latitde: 58.39 degrees North (negative for South)
* Result: Your azimuth, elevation and tilt (skew) angles.
@JDat
JDat / vswr.c
Last active June 16, 2019 11:25
Calculate VSWR from Forward and Reflected power
#include <stdio.h>
#include <math.h>
/*
* Based on https://en.wikipedia.org/wiki/Standing_wave_ratio#Relationship_to_the_reflection_coefficient
* and http://rfcalculator.mobi/vswr-forward-reverse-power.html
*/
/*
* vswr calculation from input power
@JDat
JDat / fix-null.diff
Created December 31, 2018 12:53 — forked from spotlightishere/fix-null.diff
pilot-link patch
diff -Naur pilot-link.orig/src/pilot-read-notepad.c pilot-link-0.12.5/src/pilot-read-notepad.c
--- pilot-link.orig/src/pilot-read-notepad.c 2009-06-04 08:26:19.000000000 -0500
+++ pilot-link-0.12.5/src/pilot-read-notepad.c 2017-05-07 15:12:02.000000000 -0500
@@ -166,8 +166,8 @@
width = n->body.width + 8;
png_ptr = png_create_write_struct
- ( PNG_LIBPNG_VER_STRING, png_voidp_NULL,
- png_error_ptr_NULL, png_error_ptr_NULL);
+ ( PNG_LIBPNG_VER_STRING, NULL,
@JDat
JDat / macos-patch.diff
Created December 31, 2018 12:52 — forked from spotlightishere/macos-patch.diff
Romeo patches
--- romeo-orig/types.h 2001-03-16 19:28:08.000000000 -0600
+++ romeo-0.5.0/types.h 2017-05-07 14:33:18.000000000 -0500
@@ -4,7 +4,7 @@
/********************************************************************
* Elementary data types
********************************************************************/
-#include <endian.h>
+#include <machine/endian.h>
#define CPU_ENDIAN_LITTLE __LITTLE_ENDIAN