This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP TABLE IF EXISTS rpi_models; | |
CREATE TABLE "RPI_Models" ( | |
'Family' TEXT, | |
'Model' TEXT, | |
'SoC' TEXT, | |
'Memory' REAL, | |
'Formfactor' TEXT, | |
'Ethernet' TEXT, | |
'Wireless' TEXT, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SCRIPT=$(readlink -f $0) | |
SCRIPTPATH=`dirname $SCRIPT` | |
cd "$SCRIPTPATH" | |
python3 gpxplot3.py -y elevation -x distance $1 > gpx.dat & pid1=$! | |
wait $pid1 | |
echo " | |
set output '$1.png' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math, sys, os | |
def heat_index_wpc(temp,humid): | |
# https://www.wpc.ncep.noaa.gov/html/heatindex_equation.shtml | |
T = float(temp)*9/5 +32 | |
RH = float(humid) | |
HI = -42.379 + 2.04901523*T + 10.14333127*RH - .22475541*T*RH - .00683783*T*T - .05481717*RH*RH + .00122874*T*T*RH + .00085282*T*RH*RH - .00000199*T*T*RH*RH | |
if RH < 13 and T > 80 and T < 112 : | |
HI = HI - ((13-RH)/4)*math.sqrt((17-abs(T-95))/17) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys, os, logging, datetime | |
from tp357tool import * | |
temp, humid = None, None | |
mac = 'MY:MA:CA:DD:RE:SS' | |
# Read data from ThermoPro | |
device, read, write = bt_setup(mac) | |
temp, humid = wait_for_temp(read, write) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
Title Batch convert fit to gpx | |
for %%i in (*.fit) do "C:\Program Files\GPSBabel\gpsbabel.exe" -rt -i garmin_fit -f %%i -x track,course,speed -o gpx -F %%~ni.gpx && echo [32m%%i[0m converted to [35m%%~ni.gpx[33m | |
pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ==================================================================================================================== | |
-- Author: Martin Childs | |
-- Create date: 2017-11-09 | |
-- Description: Calculates a mortgage style annuity loan payment schedule | |
-- Version: v001 | |
-- ==================================================================================================================== | |
Print'Create numbered list' | |
--http://sqlperformance.com/2013/01/t-sql-queries/generate-a-set-1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function StaticRandom(Input1 As String, Optional Rand_Input As Double = 0) As Variant | |
' Create a pseudo random number which doesn't change for a given input | |
' Martin Childs, 2016-07-05 | |
' v001 | |
' | |
Prime = 9973 | |
'Checksum | |
checksum = Len(Input1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function TrendlineParse(Eqtn As String, Optional xVal As Variant = "eq", Optional xType As Variant = 0) As Variant | |
'Function Convert trendline equations into formulas | |
' (c) Martin Childs 2017 | |
Eqtn = Replace(Eqtn, " ", "") | |
'Return equation | |
If xVal = "eq" Then | |
TrendlineParse = Eqtn | |
Exit Function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from lib_oled96 import ssd1306 | |
import time | |
#import sys | |
from PIL import ImageFont, ImageDraw#, Image | |
from smbus import SMBus | |
i2cbus = SMBus(1) # 1 = Raspberry Pi but NOT early REV1 board |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import time, sys, logging | |
from daemon2x import Daemon | |
from lib_oled96 import ssd1306 | |
from PIL import ImageFont, ImageDraw, Image | |
from smbus import SMBus | |
# Logging | |
logging.basicConfig(filename='/home/pi/oled/lib_oled96/clock.log', |
NewerOlder