Skip to content

Instantly share code, notes, and snippets.

View madeintaiwan's full-sized avatar

Nathaniel Petre madeintaiwan

  • London
View GitHub Profile
@madeintaiwan
madeintaiwan / slimmed_ecompass_code_sep_18_2.ino
Created September 17, 2013 23:50
The file that is currently on an Arduino Mega 2560 or Mega ADK with a serial number of 85235333135351C09291
// This code reads a signal from the HNC6352 in degrees and writes it to a SD card. It uses LED flashes to report success to writing and errors
//Necessary libraries
#include <Wire.h>
#include <SD.h>
// Setup the Compass I2C address
int HMC6352SlaveAddress = 0x42;
int HMC6352ReadAddress = 0x41; //"A" in hex, A command is:
int headingValue;
@madeintaiwan
madeintaiwan / simple_grapher_processing.pde
Last active December 22, 2015 05:48
The file that is currently on an Arduino Mega 2560 or Mega ADK with a serial number of 75237333536351500000
// Maurice Ribble
// 6-28-2009
// http://www.glacialwanderer.com/hobbyrobotics
// This takes data off the serial port and graphs it.
// There is an option to log this data to a file.
// I wrote an arduino app that sends data in the format expected by this app.
// The arduino app sends accelerometer and gyroscope data.
@madeintaiwan
madeintaiwan / RIT_Display_analog_signal.ino
Created September 2, 2013 09:31
This one needs some tweaking but works well in terms of simple data output and logging. Ideally I'd like a linear graph rather than plots
// Processing_Display_Analog_Signal_Fuller.pde
// Graphing sketch for multiple analog signals
// This program takes ASCII-encoded strings from the serial port at 9600 baud
// and graphs them. It expects values in the range 0 to 1023, followed by a newline
// Version 19 Dec 2010
// by Dr. Lynn Fuller, Professor, Microelectronic Engineering, Rochester Institute of Technology
// This code is in the public domain.
import processing.serial.*;
Serial myPort; // The serial port
int xPos = 1; // horizontal position of the graph
@madeintaiwan
madeintaiwan / five_analog_inputs_for_data_grapher.ino
Created September 2, 2013 09:05
The Arduino code for Tom Igoe's graphing processing code
/*
Read in five analog sensor values, send them out
as tab-delimited ASCCI-encoded decimal numbers,
ended by a carriage return and newline
created 15 Oct. 2007
*/
void setup() {
// iniaialize the serial port:
@madeintaiwan
madeintaiwan / Comparitive_analog_graph_processing.pde
Last active December 22, 2015 03:29
Tom Igoe's initial graphing code for processing
/*
Serial Graphing Sketch
by Tom Igoe
Language: Processing
This sketch takes ASCII values from the serial port
at 9600 bps and graphs them.
The values should be comma-delimited, with a newline
at the end of every set of values.
The expected range of the values is between 0 and 1023.
@madeintaiwan
madeintaiwan / Adafruit_sound_to_voltage.ino
Created September 2, 2013 08:49
Sample Adafruit code for Sound to Volts
/****************************************
Example Sound Level Sketch for the
Adafruit Microphone Amplifier
****************************************/
const int sampleWindow = 50; // Sample window width in mS (50 mS = 20Hz)
unsigned int sample;
void setup()
{