Skip to content

Instantly share code, notes, and snippets.

@hyun007
hyun007 / span.io-api-documentation.md
Last active April 9, 2024 01:22
span.io api documentation

Span.io API Documentation

The Span API does not at this time require any authentication. This will probably change in the future.

Description: Gets panel summary, firmware version, door state, serial number, network status Request: GET /api/v1/status Response:

{
  "software": {
    "firmwareVersion": "spanos2/r202216/04",
@ecaron
ecaron / button.py
Created July 31, 2016 20:59
Python script for listening to Raspberry Pi button push
import requests
import time
import RPi.GPIO as GPIO
url = 'http://nightlight/' # I map this to my internal DNS hosting the node app
gpio_pin=18 # The GPIO pin the button is attached to
longpress_threshold=5 # If button is held this length of time, tells system to leave light on
GPIO.setmode(GPIO.BCM)
GPIO.setup(gpio_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
#include "application.h"
SYSTEM_MODE(MANUAL);
int timeLastPublish = 0;
int timeBetweenPublishes = 300000;
bool sendData = false;
void dataCallbackHandler(uint8_t *data, uint16_t length) {
sendData = true;
}
@c34s3r
c34s3r / gist:19283a6fccd6509392b7
Created November 14, 2015 08:09
kivy popup with 2 buttons
I created a popup in kivy with two buttons...
one button closes the popup while the other does nothing..
I used the floatlayout ..
this is the. py file...
#-*-coding:utf8;-*-
#qpy:2
#qpy:kivy
@tshirtman
tshirtman / graph.py
Last active June 14, 2017 16:57
Kivy poor's man graph example
from kivy.lang import Builder
from kivy.properties import ListProperty
from kivy.app import App
from random import gauss
KV = '''
#:import Animation kivy.animation.Animation
#:import chain itertools.chain
#:import gauss random.gauss
@programmarchy
programmarchy / gist:c9d02e22d58bfab3f8bb
Created March 25, 2015 15:45
BluetoothLowEnergy.cpp
// BluetoothLowEnergy.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#pragma warning (disable: 4068)
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
@lexruee
lexruee / bluetooth raspberry-pi
Created January 22, 2015 05:12
install bluetooth and pybluez
sudo apt-get update
sudo apt-get install python-pip python-dev ipython
sudo apt-get install bluetooth libbluetooth-dev
sudo pip install pybluez
@electronut
electronut / ldr.py
Created May 4, 2014 06:14
Display analog data from Arduino using Python (matplotlib animation)
"""
ldr.py
Display analog data from Arduino using Python (matplotlib)
Author: Mahesh Venkitachalam
Website: electronut.in
"""
import sys, serial, argparse
@endolith
endolith / frequency_estimator.py
Last active October 30, 2023 18:08
Frequency estimation methods in Python
from __future__ import division
from numpy.fft import rfft
from numpy import argmax, mean, diff, log, nonzero
from scipy.signal import blackmanharris, correlate
from time import time
import sys
try:
import soundfile as sf
except ImportError:
from scikits.audiolab import flacread