This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2.cv as cv | |
import time | |
cv.NamedWindow('a', 1) | |
cv.NamedWindow('b', 1) | |
cv.NamedWindow('c', 1) | |
cv.NamedWindow('d', 1) | |
cap = cv.CaptureFromCAM(-1) | |
cv.SetCaptureProperty(cap, cv.CV_CAP_PROP_FRAME_HEIGHT, 240) | |
cv.SetCaptureProperty(cap, cv.CV_CAP_PROP_FRAME_WIDTH, 320) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
usb 1-1.2: new high speed USB device number 4 using dwc_otg | |
usb 1-1.2: New USB device found, idVendor=0c45, idProduct=62f1 | |
usb 1-1.2: New USB device strings: Mfr=2, Product=1, SerialNumber=0 | |
usb 1-1.2: Product: USB 2.0 Camera | |
usb 1-1.2: Manufacturer: Sonix Technology Co., Ltd. | |
Linux media interface: v0.10 | |
Linux video capture interface: v2.00 | |
uvcvideo: Found UVC 1.00 device USB 2.0 Camera (0c45:62f1) | |
input: USB 2.0 Camera as /devices/platform/bcm2708_usb/usb1/1-1/1-1.2/1-1.2:1.0/input/input0 | |
usbcore: registered new interface driver uvcvideo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See http://www.fanjita.org/serendipity/archives/53-Interfacing-with-radio-controlled-mains-sockets-part-2.html | |
#define PAYLOAD_SIZE 48 | |
#define DATA_PIN A4 | |
#define VCC_PIN A5 | |
#define GND_PIN A3 | |
#define LED_PIN 13 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See http://www.fanjita.org/serendipity/archives/51-Interfacing-with-radio-controlled-mains-sockets-part-1.html | |
#define STATE_NOISE 0 | |
#define STATE_COUNT_PRE 1 | |
#define STATE_COUNT_RISE 2 | |
#define STATE_DECODE_MSG_HI 3 | |
#define STATE_DECODE_MSG_LO 4 | |
// payload size in bits | |
#define PAYLOAD_SIZE 48 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Digital potentiometer (MSP4131) programming over SPI | |
// D. Court 8 Feb 2012. | |
// Pin assignments (arduino digital pin numbering) | |
#define SRCLK_PIN 4 | |
#define SPICLK_PIN 3 | |
#define DATA_PIN 2 | |
// /CS of each device goes to a (LSB-end) line of the shift reg D-outputs. | |
// Data line is connected to both SR and device | |
// SRCLK and RCLK are connected together on shift reg. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Power interrupter | |
#define POWER_OUT_PIN 4 // Note : sense is inverted, i.e. ON = LOW. | |
// Use of pin 4 on ATTiny allows for ISP-reprogramming | |
void setup() | |
{ | |
pinMode(POWER_OUT_PIN, OUTPUT); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Count zero crossings using analog comparator | |
// atmega328p: | |
// Uses pin 7 as the anacomp -ve input (AIN1) | |
// Uses pin 6 as the anacomp +ve input (AIN0) | |
// attiny85: | |
// Uses pin 1 as AIN1 | |
// Uses pin 0 as AIN0 | |
#ifdef __AVR_ATtiny85__ | |
#define AIN1 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Setup Timer2. | |
//Configures the 8-Bit Timer2 to generate an interrupt | |
//at the specified frequency. | |
//Returns the timer load value which must be loaded into TCNT2 | |
//inside your ISR routine. | |
//See the example usage below. | |
unsigned char SetupTimer2(float timeoutFrequency){ | |
unsigned char result; //The timer load value. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set up the comparator. | |
pinMode(AIN0, INPUT); | |
pinMode(AIN1, INPUT); | |
// ACI : Ana Comp Interrupt flag - writing a 1 clears it, hardware autoclears it when calling ISR | |
// ACIE : Ana Comp Int Enable | |
// ACIS1, ACIS0 : Ana Comp Int mode select: | |
// 0 0 Int on output toggle | |
// 0 1 Reserved | |
// 1 0 Int on falling output edge | |
// 0 1 Int on rising output edge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Controlling a servo position using a Wii Nunchuck. | |
// by Fanjita <http://www.fanjita.org/> | |
// Includes code from 'Knob' sample by Michal Rinott <http://people.interaction-ivrea.it/m.rinott> | |
#include <Wire.h> | |
#include <Servo.h> | |
#include "wiichuck.h" | |
Servo myservo; // create servo object to control a servo | |