Skip to content

Instantly share code, notes, and snippets.

View LightningStalker's full-sized avatar

LightningStalker

View GitHub Profile
@LightningStalker
LightningStalker / cvtojoule.cpp
Last active September 4, 2025 04:56
Joules caclulater for capactor of size C being charged to Voltage V
/* Capacitance + Voltage² -> joules calc
* Project Crew™ 6/28/2025
*/
#include <iostream>
#include <cmath>
#include <exception>
using namespace std;
int
@LightningStalker
LightningStalker / dewpoint.cpp
Last active July 27, 2025 21:36
Dew point calc
/* Compile with $ g++ -Wall -o dewpoint dewpoint.cpp
*
* ported from meteocalc by Project Crew™ on 7/26/2025
*/
#include <iostream>
#include <map>
#include <cmath>
#include <string>
#include <filesystem>
@LightningStalker
LightningStalker / heat_index.cpp
Last active August 1, 2025 07:29
Find the heat index
/* compile with $ g++ -Wall -Os -o heat_index heat_index.cpp
*
* ported to C++ from meteocalc by Project Crew™ 7/28/2025
* tested against "Heat index calculator" of Calculator.net
* see https://en.wikipedia.org/wiki/Heat_index
* http://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml
*/
#include <iostream>
#include <iomanip>
@LightningStalker
LightningStalker / wind_chill.cpp
Created August 1, 2025 07:27
Find the wind chill
/* Compile with $ g++ -Wall -o wind_chill wind_chill.cpp
*
* ported from meteocalc by Project Crew™ on 8/1/2025
* see https://web.archive.org/web/20110918010232/http://www.weather.gov/os/windchill/index.shtml
* https://en.wikipedia.org/wiki/Wind_chill
*/
#include <iostream>
#include <cmath>
#include <string>
@LightningStalker
LightningStalker / neoblink.ino
Created August 2, 2025 04:27
Neopixel blink sketch example
@LightningStalker
LightningStalker / Makefile
Created August 16, 2025 08:48
Build all programs in the current directory
# It builds all programs in the current directory.
SUFFIX := cpp
BASENAME := basename
ECHO := /bin/echo
RM := rm
TEST := /bin/test
XARGS := xargs
@LightningStalker
LightningStalker / sex2dec.c
Last active May 15, 2026 10:27
Convert sexagesimal GPS coordinates into decimal
/* Compile with gcc -o sex2dec sex2dec.c */
#define PROGNAME "sex2dec"
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char **argv)
{
if (argc == 5)
@LightningStalker
LightningStalker / dec2sex.c
Last active May 15, 2026 11:35
Convert decimal GPS coordinates into sexagesimal
/* Compile with gcc -o dec2sex dec2sex.c -lm */
#define PROGNAME "dec2sex"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#if defined (__DOS__)
#define DEGSYM "\xf8"
@LightningStalker
LightningStalker / beacondist.cpp
Last active September 5, 2025 23:40
distance to station based on RSSI and reference station
/* distance to station based on RSSI and reference station
* stations must be very very close to same
* Project Crew™ 9/3/2025
*/
#include <iostream>
#include <cmath>
#include <exception>
#include <filesystem>
using namespace std;
@LightningStalker
LightningStalker / bucks.c
Created September 11, 2025 10:06
Buck converter calc
/* Compile with $ gcc -Wall -o bucks bucks.c
* For Watcom: $ wcl -bcl=$(DEST_OS) -wx -fe=$(EXE_file) bucks.c
* or use make
* Buck converter Power State calculator
* Formuli from SLVA477B by TI, Rev. 8/2015
* C adaptation by Project Crew 2024
*/
#include <stdio.h>
#include <stdlib.h>