     codeValue = results->value;
     codeLen = results->bits;
   }
-}
-
-void sendCode(int repeat) {
+  
+}
+
+void sendCode() {
+  Serial.print("1");
   if (codeType == NEC) {
-    if (repeat) {
-      irsend.sendNEC(REPEAT, codeLen);
-      Serial.println("Sent NEC repeat");
-    } 
-    else {
-      irsend.sendNEC(codeValue, codeLen);
-      Serial.print("Sent NEC ");
-      Serial.println(codeValue, HEX);
-    }
+    Serial.print("Sent NEC ");
+    Serial.println(codeValue, HEX);
+    irsend.sendNEC(codeValue, codeLen);
   } 
   else if (codeType == SONY) {
-    irsend.sendSony(codeValue, codeLen);
     Serial.print("Sent Sony ");
     Serial.println(codeValue, HEX);
+    irsend.sendSony(codeValue, codeLen);
   } 
   else if (codeType == RC5 || codeType == RC6) {
-    if (!repeat) {
-      // Flip the toggle bit for a new button press
-      toggle = 1 - toggle;
-    }
+    // Flip the toggle bit for a new button press
+    toggle = 1 - toggle;
+    
     // Put the toggle bit into the code to send
     codeValue = codeValue & ~(1 << (codeLen - 1));
     codeValue = codeValue | (toggle << (codeLen - 1));

#include <WiServer.h>
#include <IRremote.h>

int RECV_PIN = 4;
int BUTTON_PIN = 5;
int STATUS_PIN = 6;

IRrecv irrecv(RECV_PIN);
IRsend irsend;

{
    irrecv.enableIRIn(); // Start the receiver
    pinMode(BUTTON_PIN, INPUT);
    Serial.begin(9600);
    
    // Initialize WiServer and have it use the sendMyPage function to serve pages
    pinMode(ledPin1, OUTPUT);
    pinMode(RECV_PIN, INPUT);
    pinMode(BUTTON_PIN, INPUT);
  
    //WiFi.init();
    WiServer.init(sendPage);
    WiServer.enableVerboseMode(true);
    states[0] = false;
    Serial.println("Started webserver ...");
}

void printStates()
{
        for (stateCounter = 0 ; stateCounter < 1; stateCounter++)
        {
            boolToString(states[stateCounter], stateBuff);
           
