Skip to content

Instantly share code, notes, and snippets.

View dontknowmyname's full-sized avatar

JOHN KING dontknowmyname

View GitHub Profile
@dontknowmyname
dontknowmyname / OV7670.c
Last active April 9, 2016 08:34
OV7670 Interface to STM32F2XX
#include <stm32f2xx_rcc.h>
#include <stm32f2xx_tim.h>
#include <stm32f2xx_gpio.h>
#include <stm32f2xx_usart.h>
#include <stm32f2xx_i2c.h>
#include <stm32f2xx_dcmi.h>
#include <stm32f2xx_dma.h>
#include <misc.h>
//Clock Configuration
#define CLKPIN GPIO_Pin_8
#!/usr/bin/python
import Tkinter as tk
import socket
UDP_IP = "192.168.1.254"
UDP_PORT = 5555
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
#define F_CPU 1000000
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <avr/sleep.h>
#include <util/twi.h>
#include <util/delay.h>
#include <avr/cpufunc.h>
void init(void);
/* gamepad.c */
/* Author: John King */
/* You are allowed to freely modify and distribute this code, but please do tell me if you find anything interesting!*/
#include<netdb.h>
#include<netinet/in.h>
#include<arpa/inet.h>
#include<sys/time.h>
#include<sys/types.h>
#include<sys/socket.h>
//This code detects the sound produced in your environment and checks it with a threshold
//If the amplitude sound in your environment crosses a threshold then an alarm is sounded (VLC is made to play a music file)
//Else nothing is done.
//
//Compile as:
//gcc -o mincap mincap.c -lasound
#include <stdio.h>
#include <string.h>
#include <alsa/asoundlib.h>
//Source: http://home.roadrunner.com/~jgglatt/tech/linuxapi.htm
//This example lists all of the digital audio input and output
//hardware (ie, ALSA pcm) ports upon all sound cards
//in the system.
//
//Compile as:
//gcc -o listpcm listpcm.c -lasound
#include <stdio.h>
#include <string.h>
//Source: http://home.roadrunner.com/~jgglatt/tech/linuxapi.htm
//cardnames.c
//Lists the names of all sound cards in the system.
//
//Compile as:
//gcc -o cardnames cardnames.c -lasound
#include <stdio.h>
#include <string.h>
#include <alsa/asoundlib.h>
;Credits MIKEOS http://http://mikeos.berlios.de
BITS 16
start:
cli ; Clear interrupts
mov ax, 0
mov ss, ax ; Set stack segment and pointer
mov sp, 0FFFFh
sti ; Restore interrupts
cld ; The default direction for string operations
;Credits MIKEOS http://http://mikeos.berlios.de
BITS 16
jmp short bootloader_start ; Jump past disk description section
nop ; Pad out before disk description
; ------------------------------------------------------------------
; Disk description table, to make it a valid floppy
@dontknowmyname
dontknowmyname / compile hello.c
Last active October 12, 2015 14:48
Compilation of WebCam Mouse
gcc hello.c -o hello `pkg-config --cflags --libs opencv`
sudo ./hello