Skip to content

Instantly share code, notes, and snippets.

View Robotonics's full-sized avatar
🏠
Working from home

David Cotterill-Drew Robotonics

🏠
Working from home
View GitHub Profile
@Robotonics
Robotonics / Arduino Xinda IR remote
Created July 17, 2014 19:34
Arduino IRremote library usage with cheap 20 button IR remote from Xinda
#include <IRremote.h>
int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
#!/usr/bin/env python2
"""
OpenCV example. Show webcam image and detect face.
"""
import cv2
TRAINSET = "/usr/share/OpenCV/lbpcascades/lbpcascade_frontalface.xml"
DOWNSCALE = 4
@Robotonics
Robotonics / ADS7843 Calibrate function
Created June 8, 2012 11:52
Calibration routine for ADS7843
void ADS7843_Calibrate(void)
{
static Coordinate *Pos;
uint16_t MatriceA[3][3] = {{1,1,1},{1,1,1},{1,1,1}}; // MatriceA for values of ADC ADS7843
uint8_t i,j; // Inserts itself into a matrix
uint32_t detA; // determinant matriceA
int32_t transA[3][3]; // transpose matriceA
float invA[3][3]; // Invert MatriceA
float pom; // to save 1/detA
@Robotonics
Robotonics / main.c
Created November 17, 2012 19:58
uart debugging example for the msp430 launchpad using usci
/*
* Program that takes commands via Async Serial, which could be useful for debugging.
* LEDs are green when transmitting data, and red when receiving data.
*
* G2553 Pinout:
* 1.0 - red status led
* 1.1 - uart input
* 1.2 - uart output
* 1.6 - green status led
*
https://www.evernote.com/shard/s247//sh/d4b767ad-9459-4493-b9e7-67e42a50acee/42a821d110aa5fa3decdc86528bfb07b
@Robotonics
Robotonics / CatAndMouse.ino
Created November 23, 2015 18:01 — forked from mbparks/CatAndMouse.ino
The Wiring code for the Arduino Esplora. Reads the Joystick X, Y, and Joystick Button. As well as the Up, Down, Left, and Right buttons. Then sets status to Processing sketch via Serial communication. Cat and Mouse is a two player game where my one player uses the Esplora and acts as the cat. The other user uses the computer's mouse and plays th…
//////////////////////////////////////////////
// CAT AND MOUSE GAME
// Author: Mike Parks
//
//////////////////////////////////////////////
// INCLUDE LIBRARIES
#include <Esplora.h>
// DECLARE GLOBAL VARIABLES
#include "lm4f120h5qr.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/i2c.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "I2C_Stellaris_API.h"
#include "utils/uartstdio.h"
@Robotonics
Robotonics / srf02.c
Created January 27, 2013 22:58
I2C driver for SRF02
/*
* srf02.c
*
* Created on: 26 Jan 2013
* Author: David
*/
//includes
#include "lm4f120h5qr.h"
#include "inc/hw_memmap.h"
@Robotonics
Robotonics / cmps03.c
Created January 27, 2013 22:54
I2C driver for cmps03 electronic compass
/*
* cmps03.c
*
* Created on: 26 Jan 2013
* Author: David
*/
// driver for cmps03 electronic compass
/*
Example: Control a WTV020-SD-16P module to play voices from an Arduino board.
Created by Diego J. Arevalo, August 6th, 2012.
Released into the public domain.
*/
#include <Wtv020sd16p.h>
int resetPin = 2; // The pin number of the reset pin.
int clockPin = 3; // The pin number of the clock pin.