Skip to content

Instantly share code, notes, and snippets.

View tomtor's full-sized avatar

Tom Vijlbrief tomtor

View GitHub Profile
@tomtor
tomtor / up2.sh
Created August 16, 2018 15:25
Wrapper to make upload.py more robust
#!/bin/sh
while :
do
if upload.py "$@"
then
break
else
echo Retry in 60s
sleep 60
@tomtor
tomtor / clone_drive.py
Last active August 16, 2018 15:23
Clone fishtest LTC PGN files to Google Drive
#!/usr/bin/env python3
import os
import sys
import subprocess
import re
import requests
import bz2
from pymongo import MongoClient, ASCENDING, DESCENDING
@tomtor
tomtor / upload.py
Last active May 18, 2018 06:47
Upload file to Google Drive
#!/usr/bin/python
import sys
import os
from optparse import OptionParser
from os.path import expanduser
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
@tomtor
tomtor / XOR.S
Last active October 13, 2017 11:18
Esp32 ULP macro function
/* r0 = r0 xor r2, spills r1 */
.macro xor
/*
See https://stackoverflow.com/a/5377173
int bitwise_XOR(int a, int b)
{
return (a + b) - (a & b) - (a & b);
}
@tomtor
tomtor / ULP-stack.S
Last active January 11, 2023 13:05
ESP32 ULP subroutine and stack macros and multiply routine
/*
* Demo of Stack and subroutine macros for ESP32 ULP
*
* R3 is the SP
*/
#include "soc/rtc_cntl_reg.h"
#include "soc/rtc_io_reg.h"
#include "soc/soc_ulp.h"
@tomtor
tomtor / ESP32-ULP-Blink-DHT22.ino
Last active August 19, 2020 08:53
ESP32: ULP LED Hart beat and read DHT22 sensor
/*******************************************************************************
Copyright (c) 2015 Thomas Telkamp and Matthijs Kooijman
(c) 2017 Tom Vijlbrief
Permission is hereby granted, free of charge, to anyone
obtaining a copy of this document and accompanying files,
to do whatever they want with them without any restriction,
including, but not limited to, copying, modification and redistribution.
NO WARRANTY OF ANY KIND IS PROVIDED.
@tomtor
tomtor / CCS811_test.ino
Last active June 2, 2017 13:46
CCS811 low power Arduino sketch
/***************************************************
This is an example for the CCS811 digital TVOC/eCO2 Sensor by CCMOSS/AMS
http://www.ccmoss.com/gas-sensors#CCS811
Updated: March 28, 2017
The sensor uses I2C protocol to communicate, and requires 2 pins - SDA and SCL
Another GPIO is also required to assert the WAKE pin for communication. this
pin is passed by an argument in the begin function.
@tomtor
tomtor / STM32-OTA.ino
Last active October 14, 2022 12:46
STM32 OTA Example
/*******************************************************************************
Copyright (c) 2015 Thomas Telkamp and Matthijs Kooijman
(c) 2017 Tom Vijlbrief
Permission is hereby granted, free of charge, to anyone
obtaining a copy of this document and accompanying files,
to do whatever they want with them without any restriction,
including, but not limited to, copying, modification and redistribution.
NO WARRANTY OF ANY KIND IS PROVIDED.
@tomtor
tomtor / STM32-LORA.ino
Last active October 14, 2022 12:46
stm32duino LORA Example
/*******************************************************************************
Copyright (c) 2015 Thomas Telkamp and Matthijs Kooijman
(c) 2017 Tom Vijlbrief
Permission is hereby granted, free of charge, to anyone
obtaining a copy of this document and accompanying files,
to do whatever they want with them without any restriction,
including, but not limited to, copying, modification and redistribution.
NO WARRANTY OF ANY KIND IS PROVIDED.