Skip to content

Instantly share code, notes, and snippets.

View tekk's full-sized avatar
💭
Just finished my EMA TTS REPORTER for HAM radio METAR annoucements

Peter Javorsky tekk

💭
Just finished my EMA TTS REPORTER for HAM radio METAR annoucements
View GitHub Profile
def hsv_to_rgb(h, s, v):
if s == 0.0:
r, g, b = v, v, v
else:
i = int(h * 6.0)
f = (h * 6.0) - i
p = v * (1.0 - s)
q = v * (1.0 - s * f)
t = v * (1.0 - s * (1.0 - f))
i = i % 6
@tekk
tekk / msys2.reg
Created February 7, 2019 12:05 — forked from magthe/msys2.reg
MSYS2 "Open Here" registry settings
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\open_msys2]
@="Open MSYS2 here"
[HKEY_CLASSES_ROOT\Directory\Background\shell\open_msys2\command]
@="c:\\msys64\\usr\\bin\\mintty.exe /bin/sh -lc 'cd \"$(cygpath \"%V\")\"; exec bash'"
[HKEY_CLASSES_ROOT\Folder\shell\open_msys2]
@="Open MSYS2 here"
@tekk
tekk / ring.ino
Last active January 8, 2019 20:56
Neopixel Ring Wemos D1 Mini
#include <Adafruit_NeoPixel.h>
#define PIN D7
#define STRIPSIZE 16
Adafruit_NeoPixel strip = Adafruit_NeoPixel(STRIPSIZE, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.setBrightness(25); // Lower brightness and save eyeballs!
@tekk
tekk / serial_tekk.py
Created April 23, 2018 03:04
Serial list ports in Python - serial_ports()
import sys
import glob
import serial
def serial_ports():
""" Lists serial port names
:raises EnvironmentError:
On unsupported or unknown platforms
void setup()
{
Serial.begin(115200);
}
void loop()
{
static unsigned long x = 0;
if (x++ % 100 == 0)
@tekk
tekk / gist:65ab3397a9d06d05c98068847ffa0b8a
Created October 18, 2016 20:44
Vypocet vzdialenosti a azimutu medzi dvoma lokatormi - JavaScript
<div id="lokator">
<span lang="sk"><form lpformnum="1">
<p align="center">Tvoj lokátor
<input maxlength="6" name="lokators" value="JN98NT" size="7" style="text-align: center; border: 1px solid #aaa;">
<span style="margin-left:1em;">Lokátor protistanice</span>
<input maxlength="6" name="lokatort" value="JN98CD" size="7" style="text-align: center; border: 1px solid #aaa;"><span lang="sk">
<input onclick="vypocet(this.form);" type="button" value="Výpočítaj" style="margin-left:1em;">
<span style="margin-left:2em; font-weight: bold;">Vzdialenosť
<input name="vzdalenost" value="" size="5" style="text-align: center; border: 1px solid #aaa; font-weight:bold;">
km</span>
/*
LiquidCrystal Library - Hello World
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
This sketch prints "Hello World!" to the LCD
and shows the time.
@tekk
tekk / nokia3310display.ino
Created July 22, 2014 19:35
Nokia 3310 display
/*
This Code has extra features
including a XY positioning function on Display
and a Line Draw function on Nokia 3310 LCD
It is modded from the original
http://playground.arduino.cc/Code/PCD8544
*/
// Mods by Jim Park
// jim(^dOt^)buzz(^aT^)gmail(^dOt^)com
// hope it works for you
@tekk
tekk / gist:7483ad2711ef822b1ff8
Created July 21, 2014 17:49
Elegant bubblesort, source: Arduino forums
void bsort(int *a, int n)
{
for (int i = 1; i < n; ++i)
{
int j = a[i];
int k;
for (k = i - 1; (k >= 0) && (j < a[k]); k--)
{
a[k + 1] = a[k];
}