Skip to content

Instantly share code, notes, and snippets.

View whatnick's full-sized avatar

Tisham Dhar whatnick

View GitHub Profile
@whatnick
whatnick / test_mpl3115.py
Last active July 21, 2016 07:55
Test MPL3115 barometer/altimeter using Python
temp_raw_file = open('/sys/class/i2c-dev/i2c-1/device/1-0060/iio:device0/in_temp_raw','r')
temp_scale_file = open('/sys/class/i2c-dev/i2c-1/device/1-0060/iio:device0/in_temp_scale','r')
print "temperature: %.2f" %(int(temp_raw_file.read())*float(temp_scale_file.read()))
pres_raw_file = open('/sys/class/i2c-dev/i2c-1/device/1-0060/iio:device0/in_pressure_raw','r')
pres_scale_file = open('/sys/class/i2c-dev/i2c-1/device/1-0060/iio:device0/in_pressure_scale','r')
print "pressure: %.4f" %(int(pres_raw_file.read())*float(pres_scale_file.read()))
'''
Created on Apr 24, 2016
@author: tisham
'''
import time
import requests
import cv2
import operator
import numpy as np
@whatnick
whatnick / Blink_7seg.ino
Last active April 19, 2016 07:56
Random number display on 7-segment LED
@whatnick
whatnick / RealPowerMeter_NoWifi
Last active March 17, 2016 14:13
Real Power meter with OLED display, no wifi
/*
* This sketch sends ads1115 current sensor data via HTTP POST request to thingspeak server.
* It needs the following libraries to work (besides the esp8266 standard libraries supplied with the IDE):
*
* - https://github.com/adafruit/Adafruit_ADS1X15
* - https://github.com/adafruit/Adafruit-GFX-Library
* - https://github.com/adafruit/Adafruit_SSD1306
*
* designed to run directly on esp8266-12 module, to where it can be uploaded using this marvelous piece of software:
*
@whatnick
whatnick / Energy_Monitor_Real.ino
Last active October 1, 2022 20:10
ESP8266 Energy Monitor Real Power
/*
* This sketch sends ads1115 current sensor data via HTTP POST request to thingspeak server.
* It needs the following libraries to work (besides the esp8266 standard libraries supplied with the IDE):
*
* - https://github.com/adafruit/Adafruit_ADS1X15
*
* designed to run directly on esp8266-01 module, to where it can be uploaded using this marvelous piece of software:
*
* https://github.com/esp8266/Arduino
*
@whatnick
whatnick / lod_load.ms
Created September 14, 2015 06:13
MAXScript to load LoD's for use in Unreal Engine
pluginManager.loadClass FbxImporter
findDir = getDir #import + @"\"
rootDir = getSavePath initialDir:findDir
tileDirs = GetDirectories (rootDir+"\\Tile*")
for theDir in tileDirs do
(
print theDir
--theDirStrg = theDir + "\\*.fbx"
--theFiles = getFiles theDirStrg
@whatnick
whatnick / Energy_Monitor.ino
Created September 3, 2015 13:08
ESP8266 Energy Monitor
/*
* This sketch sends ads1115 current sensor data via HTTP POST request to thingspeak server.
* It needs the following libraries to work (besides the esp8266 standard libraries supplied with the IDE):
*
* - https://github.com/adafruit/Adafruit_ADS1X15
*
* designed to run directly on esp8266-01 module, to where it can be uploaded using this marvelous piece of software:
*
* https://github.com/esp8266/Arduino
*
package org.whatnick.btc;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
public class btc_validate {
private final static String template = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
@whatnick
whatnick / pycuda_ray_cast.py
Created October 10, 2013 07:56
Orthogonal projection of some primitives (Sphere, Torus) using Pycuda based ray casting. Ported from - http://code.finkjensen.be/2011/11/ray-marching-on-implicit-surfaces-with-cuda-cc-and-visual-c/
'''
Created on 09/10/2013
PyCUDA api usage for ray-casting
@author: Tisham
'''
import pycuda.driver as drv
import pycuda.tools
@whatnick
whatnick / Cudaj2k MSVC 2010
Created September 11, 2013 03:37
CUDA Jpeg2000 Windows port
Index: gpu_jpeg2k/CMake/FindFreeImage.cmake
===================================================================
--- gpu_jpeg2k/CMake/FindFreeImage.cmake (revision 84)
+++ gpu_jpeg2k/CMake/FindFreeImage.cmake (working copy)
@@ -14,7 +14,7 @@
FIND_LIBRARY( FREEIMAGE_LIBRARY
NAMES FreeImage freeimage
PATHS
- ${PROJECT_SOURCE_DIR}/FreeImage
+ ${PROJECT_SOURCE_DIR}/extern/FreeImage