Skip to content

Instantly share code, notes, and snippets.

//
// sample sketch for "OpenCV for Processing" library...
//
import gab.opencv.*;
import org.opencv.core.*;
import org.opencv.imgproc.*;
String image_url = "http://example.com/path/to/movie.jpg";
OpenCV opencv;
Mat test_img;
#pragma once
#include <SDKDDKVer.h>
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <vector>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
@yoggy
yoggy / get_my_ipaddress.pde
Created December 3, 2013 12:03
get my global ip address for processing.
void setup() {
String ipaddr = loadStrings("http://checkip.amazonaws.com")[0];
println(ipaddr);
}
import java.io.*;
PImage [] imgs;
void setup() {
size(1200, 800);
File folder = new java.io.File(dataPath(""));
FilenameFilter jpgFilter = new java.io.FilenameFilter() {
public boolean accept(File dir, String name) {
@yoggy
yoggy / akii2clcd.py
Last active December 26, 2015 07:49
I2CLCD control sample code (for Akizuki AQM0802A)
#!/usr/bin/python
#
# I2CLCD control sample code (for Akizuki AQM0802A)
#
# setup
# $ sudo apt-get install i2c-tools
# $ sudo apt-get install python-smbus
#
# check
# $ sudo i2cdetect -y 0
@yoggy
yoggy / gpio_led_brink_sample.py
Created October 23, 2013 10:28
GPIO control sample code for Raspberry Pi
#!/usr/bin/python
#
# GPIO control sample code for Raspberry Pi
#
# setup
# $ sudo apt-get update
# $ sudo apt-get install python-rpi.gpio
#
# see also...
# http://elinux.org/RPi_Low-level_peripherals
#!/usr/bin/python
#
# MCP3204/MCP3208 sample program for Raspberry Pi
#
# how to setup /dev/spidev?.?
# $ suod modprobe spi_bcm2708
#
# how to setup spidev
# $ sudo apt-get install python-dev python-pip
# $ sudo pip install spidev
import processing.serial.*;
Serial serial;
PFont font;
void setup() {
size(600, 600);
serial = new Serial(this, "/dev/cu.usbmodem1421", 115200);
font = createFont("Impact", 32);
class Ball {
int x, y, dx, dy, r;
Ball() {
x = (int)random(0, width);
y = (int)random(0, height);
dx = (int)random(-10, 10);
dy = (int)random(-10, 10);
r = 10;
}
@yoggy
yoggy / ir_remote_shutter_for_nex.ino
Created September 7, 2013 10:35
IR remote shutter for Sony NEX.
//
// ir_remote_shutter_for_nex.ino - IR remote shutter for Sony NEX.
//
// this sketch is using IRremote library
// https://github.com/shirriff/Arduino-IRremote
//
#include <IRremote.h>
IRsend irsend; // please connect the IR-LED to D3.