Skip to content

Instantly share code, notes, and snippets.

/***
InputCapture.ino
Timer 1 high-resolution timing facility.
Copyright (C) 2008-2012 Bill Roy
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
@mpflaga
mpflaga / TrackPlayer.ino
Last active December 16, 2015 00:49
This sketch listens for commands from a serial terminal (such as the Serial Monitor in the Arduino IDE). Listening for either a single character menu commands or an numeric strings of an index. This sketch allows the various file formats to be played: mp3, aac, wma, wav, fla & mid. This sketch behaves nearly identical to MP3Shield_Library_Demo.i…
/**
* \file TrackPlayer.ino
*
* \brief Example sketch of using the MP3Shield Arduino driver
* \remarks comments are implemented with Doxygen Markdown format
*
* \author Bill Porter
* \author Michael P. Flaga
*
* This sketch listens for commands from a serial terminal (such as the Serial
@mpflaga
mpflaga / FileNamePlayer.ino
Last active December 16, 2015 00:59
This sketch listens for commands from a serial terminal which are TERMINATED with New Line Feeds (aka "\n" or 0xA). To use this sketch enable Serial Monitor to use NewLine's. If the Serial message is 1 byte in length and terminated by LF, the byte will be processed as menu command. If the Serial Message is larger than 1 byte it will assumed a Fi…
/**
* \file FileNamePlayer.ino
*
* \brief Example sketch of using the MP3Shield Arduino driver
* \remarks comments are implemented with Doxygen Markdown format
*
* \author Michael P. Flaga
*
* This sketch listens for commands from a serial terminal which are TERMINATED
* with New Line Feeds (aka "\n" or 0xA). To use this sketch enable Serial
@mpflaga
mpflaga / froggy14_MP3_PIR.ino
Last active February 10, 2016 16:12
Froggy14's code with corrections as to allow it to get compiled.
// libraries
#include <SPI.h>
#include <SdFat.h>
#include <SdFatUtil.h>
#include <SFEMP3Shield.h>
// initialize MP3 card
SdFat sd;
SFEMP3Shield MP3player;
// libraries
#include <SPI.h>
#include <SdFat.h>
#include <SdFatUtil.h>
#include <SFEMP3Shield.h>
// initialize MP3 card
SdFat sd;
SFEMP3Shield MP3player;
// constant variables
@mpflaga
mpflaga / MP3random.ino
Last active August 23, 2016 21:25
Simple example of playing random tracks.
// libraries
#include <SPI.h>
#include <SdFat.h>
#include <SdFatUtil.h>
#include <SFEMP3Shield.h>
#define NUMBER_OF_TRACKS 5
// initialize MP3 card
SdFat sd;
@mpflaga
mpflaga / MP3sequence.ino
Last active February 10, 2016 16:09
Simple example of playing a sequence of tracks.
// libraries
#include <SPI.h>
#include <SdFat.h>
#include <SdFatUtil.h>
#include <SFEMP3Shield.h>
// initialize MP3 card
SdFat sd;
SFEMP3Shield MP3player;
byte result; // variable for mp3 player shield, can be used to debug
@mpflaga
mpflaga / TinyIRduel.ino
Last active February 14, 2024 18:50
TinyIRdual - code for home made Magic Wand Kiosk reciever, using a DigiSpark (ATtiny85) Arduino
/*
* TinyIRDuel: IRrecvDump - dump details of IR codes with IRrecv
* IR detector/demodulator must be connected to the input RECV_PIN.
* IR Transmitter to JAM must be connected ot
* Version 0.1 July, 2013
* Author: 2013 Michael P. Flaga
*/
//List of wand ID's
#define WAND_RED1 0x1AEDC601
@mpflaga
mpflaga / MP3ButtonPlayer.ino
Last active December 21, 2015 23:29
Short Example of how to use Bounce Library to control SFEMP3Shield library
/**
* \file MP3ButtonPlayer.ino
*
* \brief Example sketch of using the MP3Shield Arduino driver using buttons,
* with improved debounce library
* \remarks comments are implemented with Doxygen Markdown format
*
* \author Michael P. Flaga
*
* This sketch demonstrates the use of digital input pins used as buttons as
@mpflaga
mpflaga / strstrSerial.ino
Last active August 29, 2015 14:05
Example of looking for specific text from serial input stream
char buffer[5];
#define buffer_size sizeof(buffer)/sizeof(buffer[0])
int8_t buffer_pos = 0;
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}