Skip to content

Instantly share code, notes, and snippets.

View bhagman's full-sized avatar

Brett Hagman bhagman

View GitHub Profile
@bhagman
bhagman / DualToneTest.ino
Last active August 29, 2015 14:20
Dual Tone Example for the Arduino/Wiring Tone Library - Melody & Harmony
// Written by Brett Hagman - [email protected]
// Dual Tone Example for the Arduino/Wiring Tone Library
#include <Tone.h>
#define REST -1
Tone MTone;
Tone HTone;
// Low frequency output on an arbitrary pin
//
// Brett Hagman ([email protected])
// (or [email protected])
const int lfPin = 6;
// Number of milliseconds between flipping the pin state
// 30 Hz = twice every 1/30 second
// Frequency = f
#include <string.h>
#include <ctype.h>
#include <SoftwareSerial.h>
// the Bluetooth Shield connects to Pin D9 & D10
SoftwareSerial bt(9,10);
const uint8_t req[5] = {0x00, 0x01, 0x00, 0x11, 0x00};
const uint8_t cap[17] = {0x00, 0x0d, 0x00, 0x11, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32};
const uint8_t ping[9] = {0x00, 0x05, 0x07, 0xd1, 0x00, 0xde, 0xad, 0xbe, 0xef};
@bhagman
bhagman / astylerc
Created December 20, 2013 17:25
My standard AStyle parameters for C/C++ source.
# AStyle: http://astyle.sourceforge.net/
#
# C/C++ Standard code formatting - Brett Hagman
#
# Allman, 2 space indent, indent classes,
# space padding around operators, space padding,
# remove extra space padding around parentheses,
# convert all tabs to spaces, indent switches,
# indent cases
/*
||
|| @author Alexander Brevig <[email protected]>
|| @url http://wiring.org.co/
|| @contribution Brett Hagman <[email protected]>
|| @contribution Hernando Barragan <[email protected]>
||
|| @description
|| | A public field wrapper for providing assignment safe guards
|| #