Skip to content

Instantly share code, notes, and snippets.

View lorforlinux's full-sized avatar
🐾
small steps for big future

Deepak Khatri lorforlinux

🐾
small steps for big future
View GitHub Profile
@ximeg
ximeg / ThresholdingAlgo.py
Created April 20, 2017 07:20
Python implementation of smoothed z-score algorithm from http://stackoverflow.com/a/22640362/6029703
#!/usr/bin/env python
# Implementation of algorithm from http://stackoverflow.com/a/22640362/6029703
import numpy as np
import pylab
def thresholding_algo(y, lag, threshold, influence):
signals = np.zeros(len(y))
filteredY = np.array(y)
avgFilter = [0]*len(y)
stdFilter = [0]*len(y)
@pdp7
pdp7 / config-pin beaglebone start up.md
Last active September 24, 2023 21:49
config-pin beaglebone start up

Create file /usr/bin/enable-i2c-pins.sh

  • sudo vi /usr/bin/enable-i2c-pins.sh
#!/bin/bash

config-pin p9.17 i2c
config-pin p9.18 i2c
  • sudo chmod 755 /usr/bin/enable-i2c-pins.sh
@JamesDunne
JamesDunne / i2c.c
Last active April 11, 2024 10:54
C library for reading/writing I2C slave device registers from Raspberry Pi 1 Model B
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <linux/i2c-dev.h>
// Terrible portability hack between arm-linux-gnueabihf-gcc on Mac OS X and native gcc on raspbian.
#ifndef I2C_M_RD
#include <linux/i2c.h>
#endif