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 / 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
#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 / 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
@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"
/*
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.
@Robotonics
Robotonics / gist:5420129
Last active December 16, 2015 10:29
Arduino BTMP04
#include <glcd.h>
#include <glcd_Buildinfo.h>
#include <glcd_Config.h>
#include <fonts/allFonts.h>
#include <Wtv020sd16p.h>
int resetPin = 2; // The pin number of the reset pin.
int clockPin = 12; // The pin number of the clock pin.
int dataPin = 13; // The pin number of the data pin.
@Robotonics
Robotonics / GLCD Title text area
Created April 21, 2013 20:57
Extract from function to create and print Title for Bluetooth mp3 player project.
Title.DefineArea(1,0,19,1);
Title.SelectFont(System 5x7);
Title.CursorTo(0,0);
Title.Print("Alison's MP3 Player");
void print_title(void) {
Title.DefineArea(1,0,19,1);
Title.SelectFont(System 5x7);
Title.CursorTo(0,0);
Title.print ("Alison's MP3 player");
return;
}