Skip to content

Instantly share code, notes, and snippets.

@tako2
tako2 / theta360.py
Created December 1, 2013 14:13
Controlls RICOH THETA 360 (Python).
#!/usr/bin/env python
# coding: UTF-8
import socket
import struct
DEBUG = True
DEBUG2 = False
PTP_OC_GetDeviceInfo = 0x1001
@tako2
tako2 / twelog.py
Last active June 4, 2016 08:55
Log serial text from ToCoStick (TWE - wireless usb device). This code needs python-serial and python-daemon.
#!/usr/bin/env python
# coding: UTF-8
from __future__ import with_statement
import sys
import serial
import os.path
import datetime
@tako2
tako2 / take_picture.js
Last active December 14, 2015 17:14
node.js script for taking picture with THETA S API. It needs request module.
var request = require('request');
var options = {
uri: 'http://192.168.1.1/osc/commands/execute',
headers: { 'Content-Type': 'application/json;charset=utf-8' },
json: true,
keepAlive: false,
body: { "name": "camera.startSession" }
};
@tako2
tako2 / list_images.js
Created November 15, 2015 06:12
node.js script for getting list of images with THETA S API. it needs "request" module.
var request = require('request');
var options = {
uri: 'http://192.168.1.1/osc/commands/execute',
headers: { 'Content-Type': 'application/json;charset=utf-8' },
json: true,
keepAlive: false,
body: { "name": "camera.listImages",
"parameters": {
"entryCount": 100,
@tako2
tako2 / get_image.js
Created November 15, 2015 06:13
node.js script for getting image file from THETA S.
var request = require('request');
var fs = require('fs');
if (process.argv.length < 3) {
console.log('node get_image.js [Filename]');
console.log("\tFilename: Image Filename such as R0010010.JPG");
return;
}
var file_uri = process.argv[2];
@tako2
tako2 / nmeaparser.py
Created June 4, 2016 09:00
Parse NMEA format to KML format
#!/usr/bin/env python
# coding: UTF-8
import sys
import StringIO
###############################################################################
class NMEAParser:
# -------------------------------------------------------------------------
def __init__(self):
@tako2
tako2 / img2bmp.py
Last active August 20, 2016 00:47
Convert Image to Arduboy Bitmap
#!/usr/bin/env python
# coding: UTF-8
from PIL import Image, ImageEnhance
import Tkinter
from ScrolledText import *
###############################################################################
def draw_bitmap(canvas, rgb, max_xy, bmp_xy, start_xy, mask):
@tako2
tako2 / arduboy_manager.py
Created September 28, 2017 09:46
Arduboy HEX File Manager for MacOS
#!/usr/bin/env python
# coding: UTF-8
# Arduboy HEX File Manager
import Tkinter
from ScrolledText import *
from PIL import Image, ImageEnhance, ImageTk
@tako2
tako2 / index.js
Created December 11, 2017 03:09
this file is node.js module, place the file to node_module/irkit/index.js and change "esp_irkit.local" to "irkit.local" if needed.
var request = require('request');
var fs = require('fs');
function postMessages(body, callback)
{
var options = {
uri: 'http://esp_irkit.local/messages',
method: 'POST',
headers: { 'Content-Type': 'application/json',
'Content-Length': body.length },
@tako2
tako2 / ohm_off.json
Created December 11, 2017 03:21
IRKit's IR signal data for the remote outlet OHM's OCR-05W
{"format":"raw","freq":38,"data":[3394,5190,1778,1600,1806,3632,1756,1598,1806,1554,1754,3684,1744,1608,1752,3684,1754,3674,1754,107540,5272,5224,1756,1546,1762,3674,1752,1602,1762,1598,1762,3674,1756,1596,1764,3684,1744,3674,1806,107496,5228,5268,1704,1604,1756,3674,1806,1546,1764,1600,1806,3630,1756,1598,1806,3630,1756,3674,1754,107550,5220,5198,1782,1598,1762,3674,1754,1598,1810,1554,1756,3680,1756,1598,1762,3674,1754,3674,1808,107496,5222,5276,1702,1598,1764,3674,1754,1598,1764,1598,1764,3674,1752,1602,1806,3630,1754,3674,1752,107550,5222,5276,1692,1608,1756,3674,1806,1554,1756,1598,1762,3674,1756,1598,1762,3674,1754,3674,1756]}