Skip to content

Instantly share code, notes, and snippets.

@brunokruse
brunokruse / photo-exif.txt
Created October 2, 2017 03:05
test exif
{
'YResolution': (72, 1),
'ResolutionUnit': 2,
'Make': u 'Apple',
'Flash': 16,
'SceneCaptureType': 0,
'GPSInfo': {
1: u 'N',
2: ((40, 1), (41, 1), (4204, 100)),
3: u 'W',
@brunokruse
brunokruse / template.html
Created September 22, 2017 17:39
simple html / javascript
<html>
<head>
<style>
body {
background: #FF00AA
}
@brunokruse
brunokruse / template.html
Created September 22, 2017 17:39
simple html / javascript
<html>
<head>
<style>
body {
background: #FF00AA
}
@brunokruse
brunokruse / fw-ppg-heartbeat
Created July 30, 2017 23:19
floating workshjops esp32 ppg + neopixel (the blinking is kinda shitty but it works)
/*
Optical Heart Rate Detection (PBA Algorithm) using the MAX30105 Breakout
By: Nathan Seidle @ SparkFun Electronics
Date: October 2nd, 2016
https://github.com/sparkfun/MAX30105_Breakout
This is a demo to show the reading of heart rate or beats per minute (BPM) using
a Penpheral Beat Amplitude (PBA) algorithm.
It is best to attach the sensor to your finger using a rubber band or other tightening
#!/usr/bin/env python
#
# ESP8266 & ESP32 ROM Bootloader Utility
# Copyright (C) 2014-2016 Fredrik Ahlberg, Angus Gratton, Espressif Systems (Shanghai) PTE LTD, other contributors as noted.
# https://github.com/espressif/esptool
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later version.
#
import RPi.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11, GPIO.IN) #Read output from PIR motion sensor
GPIO.setup(3, GPIO.OUT) #LED output pin
while True:
i=GPIO.input(11)
if i==0: #When output from motion sensor is LOW
print "No intruders",i
@brunokruse
brunokruse / angleLerp.js
Created March 20, 2016 02:46 — forked from shaunlebron/angleLerp.js
The best way to interpolate 2D angles
/*
2D Angle Interpolation (shortest distance)
Parameters:
a0 = start angle
a1 = end angle
t = interpolation factor (0.0=start, 1.0=end)
Benefits:
1. Angles do NOT need to be normalized.
/* Charliplexing 6 LEDs
--------------------------------------------------------------------------------
Row 1 (R1): Arduino Pin 13
Row 2 (R2): Arduino Pin 12
Row 3 (R3): Arduino Pin 11
--------------------------------------------------------------------------------
variable pinMode state
L OUTPUT LOW
H OUTPUT HIGH
Z INPUT LOW
@brunokruse
brunokruse / Ambient Light Sensor Smoothing
Created March 17, 2015 08:01
Ambient Light Sensor Smoothing - Based off Arduino Example
/*
ARDUINO to UNITY3D Smooth data example
Based off Arduino smoothing code by:
David A. Mellis and Tom Igoe
This example code is in the public domain.
*/