 /* -*- mode: c; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*-
 
-  G35: An Arduino library for GE Color Effects G-35 holiday lights.
-  Copyright © 2011 The G35 Authors. Use, modification, and distribution are
-  subject to the BSD license as described in the accompanying LICENSE file.
+   G35: An Arduino library for GE Color Effects G-35 holiday lights.
+   Copyright © 2011 The G35 Authors. Use, modification, and distribution are
+   subject to the BSD license as described in the accompanying LICENSE file.
 
-  Ticon2011.ino is the code that I used for Christmas 2011 at my home. It's yet
-  another demonstration of working code.
+   Ticon2011.ino is the code that I used for Christmas 2011 at my home. It's yet
+   another demonstration of working code.
 
-  By Mike Tsao <github.com/sowbug>. See README for complete attributions.
+   By Mike Tsao <github.com/sowbug>. See README for complete attributions.
 */
 
 // If defined, then a 38KHz IR receiver is supplying data on pin 11. I didn't
 // really use this much; if it detects any recognized remote code, it skips to
 // the next program. So in theory people driving by my house who happen to have
 // a TV remote in their car could stop and change the program.
+//
+// Pretty much any of these IR receivers will work. I used a Vishay Semi
+// TSOP58038 (http://octopart.com/partsearch#search/requestData&q=TSOP58038).
 #define USE_REMOTE 1
 
 // If defined, then the hardware is an Arduino. If not, then it's a Teensy.
-// More described below. I used this because I had an Arduino in the house
-// when I was writing new programs, then ran outside in the cold with my
+// More described below. I used this switch because I had an Arduino in the
+// house when I was writing new programs, then ran outside in the cold with my
 // laptop to reprogram the Teensy that was running the real lights.
 #define ARDUINO 1
 

G35StringGroup string_group;

LightProgram* CreateProgram(uint8_t program_index) {
  randomSeed(rand() + analogRead(0));
  program_index = rand() % PROGRAM_COUNT;

  if (program_index < StockProgramGroup::ProgramCount) { 
    return stock_programs.CreateProgram(string_group, program_index); 
  } 
  program_index -= StockProgramGroup::ProgramCount; 

  if (program_index < PlusProgramGroup::ProgramCount) {
    return plus_programs.CreateProgram(string_group, program_index);


#ifdef USE_REMOTE
  if (ir.decode(&ir_results)) {
    runner.switch_program();
    ir.resume();
  }
