 }
 
 
+// Get the state of a single input and optionally automatically output it
+void inputStatus(int id, bool output) {
+  states[id] = digitalRead(id);
+    
+  if (states[id] != lastStates[id]) {
+    if (output) {
+      outputState(id, EGRESS);
+    }
+    lastStates[id] = states[id];
+  }
+}
+
+
+// Return status all inputs
+void version() {
+  Serial.print("{\"result\":\"");
+  Serial.print(VERSION);
+  Serial.println("\"}");
+}
+
+
 // Return an error messagse
 void error(String message) {
   Serial.print("{\"error\":\"");

}

void loop() {
  incoming = "";
  byte incomingByte;
  

const String VERSION = "0.1.0";

const int EGRESS = 0;
const int MOTION = 1;
const int TRIP   = 2;
