+#include <MemoryFree.h>
 #include <stdinout.h>
 #include <vector.h>
 #include <Debug.h>

#define LEDPIN 13
#define RFPIN 12
#define DOG_SIGNATURE "Dog"
#define BITRATE 9600

#define LIGHTS_SIG 0b0111000101010101

  lights.send(pattern);
}

void testCmd(Vector<char*> args) {
  debug.debug("Running test command");
  String argsStr = "";
  for (int i = 0; i < args.size(); i++) {
      argsStr += args[i];
      if (i < args.size()-1) argsStr += "`, `"; // don't add this the last time
  }
  char argsChars[argsStr.length()+1];
  argsStr.toCharArray(argsChars, argsStr.length()+1);
  
  debug.info("Recieved test command with args: `%s`", argsChars);
}

void setup() {
  Serial.begin(BITRATE);
  initializeSTDINOUT(); //! see if this needs to be here
  puts(" ");
  puts(" ");
  puts(" ");
  pinMode(LEDPIN, OUTPUT);
  
  debug.begin(Debug::DEBUG, BITRATE);
  
  raspi.begin(DOG_SIGNATURE, Debug::DEBUG, DOG_DEBUG_PREFIX);
  raspi.registerCommand("lights", lightsCmd);
  raspi.registerCommand("test", testCmd);
  
  lights.begin(LIGHTS_SIG, LIGHTS_TERMINATION, RFPIN);
  
  debug.info("RoomControl setup complete");
}

void loop() {
