very close!

very close!

--- button_multichannel_rf2/button_multichannel_rf2.ino
+++ button_multichannel_rf2/button_multichannel_rf2.ino
@@ -347,7 +347,7 @@

 // Set ADC initialization bits - make sure things haven't gotten misconfigured.
     // 6: right adjust bits // last 5 bits select ADC.
-    ADMUX = adcSensePorts[0];
+    ADMUX = adcSensePorts[3];
     // high speed mode / 0 / analog selection, extra bit.
     ADCSRB = B10100000;
     // disable adc
@@ -361,25 +361,23 @@

     delayMicroseconds(chargeDelay_micros);
 // start measurement
-    for(int i = 0; i < 4; i++) {
+// Go backwords so that channel 4 has the lowest sensitivity and 1 has the highest.
+    for(int i = 3; i >= 0; i--) {
       if (toSense_internal[i]) {
         // enable / start / auto trigger / interrupt flag / interrupt enable /// scale /// p.315
         ADCSRA = B11000110;
         delayMicroseconds(50);
-        ADMUX = adcSensePorts[(i + 1) % 4];
+        ADMUX = adcSensePorts[(i + 3) % 4];
         while ((ADCSRA & B01000000));
         sampleVal = ADCL;    // store lower byte ADC
         sampleVal += ADCH << 8;  // store higher bytes ADC
         senseResults_internal[i] = sampleVal;
       }
       else {
-        ADMUX = adcSensePorts[(i + 1) % 4];
+        ADMUX = adcSensePorts[(i + 3) % 4];
         senseResults_internal[i] = -1;
       }
-//      Serial.print(sampleVal);
-//      Serial.print(", ");
-    }
-//    Serial.println(" ");
+    }

    //  digitalWrite(elEnable, HIGH);
    PORTF = PORTF | B00100000;
@@ -463,6 +461,8 @@

 //////////~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~///////////

+int* senseResults;
+
 void setup() {
   Serial.begin(9600);

@@ -494,7 +494,12 @@

   // this should be called after the clear pin is set low
   ensureCorrectFrequency();
-}
+  senseResults = senseAll(1500, true);
+}
+
+#define ENABLE_LOGGING
+
+#ifdef ENABLE_LOGGING

 // Do this instead of using a bunch of individual Serial.print statements to save time!
 // If your wire starts flashing when you are logging, this might be why!
@@ -510,6 +515,8 @@
 char tailMeanBufferBuffer[subBufferSize];
 char derivativeBuffer[subBufferSize];

+#endif
+
 int val = 0;

 int minimum = 10000;
@@ -530,8 +537,6 @@
 bool isOn = true;
 bool justSwitched = false;
 int switchedCount = 0;
-
-int* senseResults;

 #define smoothedSenseSize 15
 int smoothedSenseHistory[channelCount][smoothedSenseSize];
@@ -548,10 +553,16 @@
 int chanImpulse;
 int chanPrevImpulse;
 int chanChangeCount;
-int chanThreshold[] = {4,4,4,4};
+
+// Here are the main levers which control the operation of this program
+#define increaseWindow 9
+#define pureIncreaseThreshold 5
+#define increaseThresholdWithImpulse 3
+#define impulseThreshold 4
+#define glowTime_ms 6

 void loop() {
-    senseResults = senseAll(1500, true);
+    senseResults = senseAll(1300, true);

     smoothedSenseIter = (smoothedSenseIter + 1) % smoothedSenseSize;

@@ -598,7 +609,7 @@
       chanChangeCount = 0;

       int senseDiff;
-      for (int steps = 0; steps < 9; steps++) {
+      for (int steps = 0; steps < increaseWindow; steps++) {
         senseDiff = smoothedSenseHistory[channel][(smoothedSenseIter - (steps + 1) + smoothedSenseSize) % smoothedSenseSize]
             - smoothedSenseHistory[channel][(smoothedSenseIter - (steps) + smoothedSenseSize) % smoothedSenseSize];

@@ -610,18 +621,13 @@

       if (switchedCount == 0 &&
-           ((chanImpulse > 3 && chanChangeCount >= 3) ||
-            (chanChangeCount >= 5)) ){
+           ((chanImpulse > impulseThreshold && chanChangeCount >= increaseThresholdWithImpulse) ||
+            (chanChangeCount >= pureIncreaseThreshold)) ){
         isTouched = true;
         whereTouched[channel] = true;
       }

-      if (switchedCount == 0 &&
-           chanImpulse <= 0 &&
-//           chanPrevImpulse > chanThreshold[channel] &&
-           chanChangeCount >= 3){
-        Serial.print("sdfsdfsddsfsdfds    ");
-      }
+#ifdef ENABLE_LOGGING

     // EXEX - Logging inline - pull into a function!
     int tailMeanlen;
@@ -654,18 +660,12 @@
       default:
         break;
     }
-
-
-
-
-
-
-
-
-    }
-
+#endif
+
+    }
+
+#ifdef ENABLE_LOGGING
   int signallen;
-
   for (int chan = 0; chan < channelCount; chan++) {
     switch (chan) {
       case 0:
@@ -694,6 +694,7 @@
            derivativeBuffer, "");

   Serial.println(logBuffer);
+#endif

@@ -708,10 +709,6 @@
         }
       }
       switchedCount = 1.5 * smoothedSenseSize;
-//      if (switchedCount < 50) {
-//        switchedCount = 50;
-//      }
-//      smoothedSenseIter = 0;
     }

     switchOutputs(glow);
@@ -720,5 +717,5 @@
       switchedCount--;
     }

-    delay(8);
-}
+    delay(glowTime_ms);
+}


updated for compatibility with new DST library version

updated for compatibility with new DST library version

--- WordClock_NeoMatrix8x8/WordClock_NeoMatrix8x8.ino
+++ WordClock_NeoMatrix8x8/WordClock_NeoMatrix8x8.ino
@@ -104,6 +104,10 @@
 RTC_DS1307 RTC; // Establish clock object
 DST_RTC dst_rtc; // DST object

+// Define US or EU rules for DST comment out as required. More countries could be added with different rules in DST_RTC.cpp
+const char rulesDST[] = "US"; // US DST rules
+// const char rulesDST[] = "EU";   // EU DST rules
+
 DateTime theTime; // Holds current clock time

 int j;   // an integer for the color shifting effect


Mode three now accessible (darn precedence bit me), and it does somthing more interesting than before.

--- switchbox.ino
+++ switchbox.ino
@@ -65,6 +65,7 @@
 uint32_t animation_target_color = 0;
 uint16_t wipe_animation_delay = 25;
 uint16_t chase_animation_delay = 50;
+uint16_t rainbow_wheel_speed = 1;

 uint16_t red_blink_interval, grn_blink_interval, blu_blink_interval, blink_counter;

@@ -90,7 +91,7 @@
         strip.setPixelColor(anim_i, Wheel(((anim_i * 256 / strip.numPixels()) + anim_j) & 255));
       }
       strip.show();
-      anim_j = (anim_j + 1) & 255;
+      anim_j = (anim_j + rainbow_wheel_speed) & 255;
       next_animation_time = now + 20;
       break;

@@ -197,7 +198,6 @@
     if ( ! *btn_dwn ) {
       btn_debounce_timer = millis();
       *btn_dwn = true;
-      // digitalWrite(btn_pin, HIGH); // reset pullup resistor
       // write new random seed based on timing and current random number
       // randomSeed(random(1024)^(btn_debounce_timer&1023));
       return true;
@@ -206,7 +206,6 @@
     if ( *btn_dwn ) {
       btn_debounce_timer = millis();
       *btn_dwn = false;
-      // digitalWrite(btn_pin, HIGH); // reset pullup resistor
       return true;
     }
   }
@@ -251,14 +250,12 @@

 void loop() {
   // deal with millis() rollover
-  /*
   if ( millis() < btn_debounce_timer ) {
     btn_debounce_timer = 0;
   }
-  */

   if ( btn_read(&sw1_on, SW1_PIN) || btn_read(&sw2_on, SW2_PIN) || curr_mode < 0 ) {
-    int new_mode = sw1_on?1:0 + sw2_on?2:0;
+    int new_mode = (sw1_on?1:0) + (sw2_on?2:0);
     switch (new_mode) {
       case 0:
         animation_mode = chaser;
@@ -334,9 +331,15 @@

       if ( btn_read(&big_btn_down, BIGBTN_IN) ) { // big button pressed
         if ( big_btn_down ) {
-          dir_b = 5;
-          dir_r = 5;
-          dir_g = -5;
+          if ( dir_b == 5 && dir_r == 5 && dir_g == -5 ) {
+            dir_b = random(-10, 11);
+            dir_g = random(-10, 11);
+            dir_r = random(-10, 11);
+          } else {
+            dir_b = 5;
+            dir_r = 5;
+            dir_g = -5;
+          }
         }
       }
       break;
@@ -489,6 +492,23 @@
       }
       break;
     case 3:
+      if ( btn_read(&red_btn_down, REDBTN_IN) && red_btn_down ) {
+        rainbow_wheel_speed = rainbow_wheel_speed^1;
+      }
+
+      if ( btn_read(&grn_btn_down, GRNBTN_IN) && grn_btn_down ) {
+        rainbow_wheel_speed = rainbow_wheel_speed^2;
+      }
+
+      if ( btn_read(&blu_btn_down, BLUBTN_IN) && blu_btn_down ) {
+        rainbow_wheel_speed = rainbow_wheel_speed^4;
+      }
+
+      // Write status of bits out
+      digitalWrite(REDBTN_OUT, ((rainbow_wheel_speed&1)!=0)?HIGH:LOW);
+      digitalWrite(GRNBTN_OUT, ((rainbow_wheel_speed&2)!=0)?HIGH:LOW);
+      digitalWrite(BLUBTN_OUT, ((rainbow_wheel_speed&4)!=0)?HIGH:LOW);
+
       break;
     default:
       // nothing


happy birthday

happy birthday


ported captouchpaint to spi ili9341

ported captouchpaint to spi ili9341

--- CapTouchPaint/CapTouchPaint.ino
+++ CapTouchPaint/CapTouchPaint.ino
@@ -20,8 +20,8 @@

  ****************************************************/

-#include <Adafruit_GFX.h>
-#include <Adafruit_TFTLCD.h>
+#include <SPI.h>
+#include "ILI9341_t3.h"
 #include <i2c_t3.h>
 #include <Adafruit_FT6206.h>

@@ -35,14 +35,11 @@
 // The FT6206 uses hardware I2C (SCL/SDA)
 Adafruit_FT6206 ctp = Adafruit_FT6206();

-#define LCD_CS 15   // chip select
-#define LCD_CD 20   // command/data
-#define LCD_WR 22   // write
-#define LCD_RD 21   // read
+#define TFT_DC 22
+#define TFT_CS 20

-#define LCD_RESET 23
-
-Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
+// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
+ILI9341_t3 tft = ILI9341_t3(TFT_CS, TFT_DC, 255, 11, 14, 12);

 // Size of the color selection boxes and the paintbrush size
 #define BOXSIZE 40
@@ -61,11 +58,11 @@

 void touchDetected(){
   // Retrieve a point
-  TS_Point p = ctp.getPoint();
+  POINT p = ctp.getPoint();

   // flip it around to match the screen.
-  p.x = map(p.x, 0, 240, 240, 0);
-  p.y = map(p.y, 0, 320, 320, 0);
+  // p.x = map(p.x, 0, 240, 240, 0);
+  // p.y = map(p.y, 0, 320, 320, 0);

   // Print out the remapped (rotated) coordinates
   Serial.print("("); Serial.print(p.x);
@@ -120,9 +117,8 @@
   Serial.begin(115200);
   Serial.println(F("Cap Touch Paint!"));

-  tft.reset();
-  tft.begin(0x9341);
-  tft.setRotation(2);
+  tft.begin();
+  tft.setRotation(3);
   tft.fillScreen(BLACK);
   tft.setTextColor(GREEN);
   tft.setTextSize(3);
@@ -148,7 +144,7 @@
   currentcolor = RED;

   pinMode(IRQ, INPUT);
-  //attachInterrupt(IRQ, touchDetected, LOW);
+  attachInterrupt(IRQ, touchDetected, LOW);

   pinMode(LITE, OUTPUT);
   analogWriteResolution(12);
@@ -160,8 +156,8 @@
   analogWrite(LITE, (int)(1000));
   //Serial.println(digitalRead(IRQ));
   // Wait for a touch
-  if (digitalRead(IRQ) == HIGH) {
-    return;
-  }
+  // if (digitalRead(IRQ) == HIGH) {
+  //   return;
+  // }
   touchDetected();
 }


added backligth

added backligth


Nightlight time based colour

Nightlight time based colour

--- tree/tree.ino
+++ tree/tree.ino
@@ -1,4 +1,7 @@
 #include <Adafruit_NeoPixel.h>
+#include <Time.h>
+#include <Wire.h>
+#include <DS3232RTC.h>

 #define PIXEL_PIN   13    // Digital IO pin connected to the NeoPixels.
 #define PIXEL_COUNT 22
@@ -108,15 +111,20 @@

   uint32_t colour()
   {
-    return Adafruit_NeoPixel::Color(brightness, brightness/2, 0);
+    if (timeStatus() == timeSet) {
+      const time_t t = now();
+      if (hour(t) >= 6 && hour(t) < 18) {
+        return Adafruit_NeoPixel::Color(brightness, brightness/2, 0);
+      }
+    }
+
+    return Adafruit_NeoPixel::Color(brightness, 0, brightness);
   }
 };

 Adafruit_NeoPixel pixels(PIXEL_COUNT, PIXEL_PIN);
 Button button(BUTTON_PIN);
 Nightlight nightlight;
-byte on = false;
-byte lastHeld = false;

 void setup()
 {
@@ -124,25 +132,31 @@
   pixels.show();
   button.setup();
   Serial.begin(9600);
-  Serial.println("Hello");
+  setSyncProvider(RTC.get);
+  if (timeStatus() != timeSet) {
+    Serial.println("Unable to sync with RTC");
+  } else {
+    Serial.println("RTC has set the system time");
+  }
 }

 void loop()
 {
+  static uint32_t lastColour = 0;
+  static byte on = false;
+  static byte lastHeld = false;
+
   button.read();

   if (button.pressed()) {
     on = !on;
     if (on) {
       Serial.println("Turning on");
-      for (int i = 0; i != pixels.numPixels(); ++i) {
-        pixels.setPixelColor(i, nightlight.colour());
-      }
     } else {
       Serial.println("Turning off");
       pixels.clear();
+      pixels.show();
     }
-    pixels.show();
   }

   const byte held = button.held();
@@ -154,10 +168,6 @@
       on = true;
       nightlight.reset();
     }
-    for (int i = 0; i != pixels.numPixels(); ++i) {
-      pixels.setPixelColor(i, nightlight.colour());
-    }
-    pixels.show();
   }

   if (held != lastHeld) {
@@ -167,6 +177,15 @@
     }
   }

+  const uint32_t colour = nightlight.colour();
+  if (lastColour != colour) {
+    for (int i = 0; i != pixels.numPixels(); ++i) {
+        pixels.setPixelColor(i, colour);
+    }
+    pixels.show();
+    lastColour = colour;
+  }
+
   delay(10);
 }


Support 38400 (SwiftLink etc), menu: remove autostart and add phonebook auto-connect, memory reduction.

--- MicroView/WiFiModem-Menu/WiFiModem-Menu.ino
+++ MicroView/WiFiModem-Menu/WiFiModem-Menu.ino
@@ -33,9 +33,9 @@

 // Configuration 0v3: Wifi Hardware, C64 Software.

-int BAUD_RATE=2400;
+unsigned int BAUD_RATE=2400;
 //#define BAUD_RATE 2400
-int WiFly_BAUD_RATE=2400;
+unsigned int WiFly_BAUD_RATE=2400;
 //#define WiFly_BAUD_RATE 2400
 #define MIN_FLOW_CONTROL_RATE 4800  // If BAUD rate is this speed or higher, RTS/CTS flow control is enabled.

@@ -72,13 +72,13 @@
 #define ESCAPE_GUARD_TIME 1000

 char autoConnectHost = 0;
-boolean autoConnectedAtBootAlready = 0;           // We only want to auto-connect once..
+//boolean autoConnectedAtBootAlready = 0;           // We only want to auto-connect once..
 #define ADDR_HOST_SIZE     40
 #define ADDR_HOST_ENTRIES  9

 // EEPROM Addresses
 #define ADDR_PETSCII       0
-#define ADDR_AUTOSTART     1
+//#define ADDR_AUTOSTART     1
 #define ADDR_BAUD_LO       2
 #define ADDR_BAUD_HI       3
 #define ADDR_MODEM_ECHO         10
@@ -129,9 +129,9 @@
 #define AUTO_QLINK    3
 #define AUTO_CUSTOM   100   // TODO

-#ifndef HAYES
-byte autostart_mode = EEPROM.read(ADDR_AUTOSTART);    // 0-255 only
-#endif
+//#ifndef HAYES
+//byte autostart_mode = EEPROM.read(ADDR_AUTOSTART);    // 0-255 only
+//#endif

 // ----------------------------------------------------------
 // Arduino Setup Function
@@ -154,7 +154,7 @@
     }

     BAUD_RATE = (EEPROM.read(ADDR_BAUD_LO) * 256 + EEPROM.read(ADDR_BAUD_HI));
-    if (BAUD_RATE != 1200 && BAUD_RATE != 2400 && BAUD_RATE != 4800 && BAUD_RATE != 9600 && BAUD_RATE != 19200)
+    if (BAUD_RATE != 1200 && BAUD_RATE != 2400 && BAUD_RATE != 4800 && BAUD_RATE != 9600 && BAUD_RATE != 19200 && BAUD_RATE != 38400)
         BAUD_RATE = 2400;

     //
@@ -174,7 +174,7 @@
     //sprintf(temp, "Baud\ndetected:\n%ld", detectedBaudRate);
     //Display(temp);

-    if (detectedBaudRate == 1200 || detectedBaudRate == 2400 || detectedBaudRate == 4800 || detectedBaudRate == 9600 || detectedBaudRate == 19200) {
+    if (detectedBaudRate == 1200 || detectedBaudRate == 2400 || detectedBaudRate == 4800 || detectedBaudRate == 9600 || detectedBaudRate == 19200 || detectedBaudRate == 38400) {
         char temp[6];
         sprintf_P(temp, PSTR("%ld"), detectedBaudRate);
         Display(temp);
@@ -224,7 +224,8 @@
         //C64Serial.begin(BAUD_RATE);

         //delay(1000);
-
+
+        C64Serial.println();
         DisplayBoth(F("Wi-Fi Init..."));

 #ifdef DEBUG
@@ -257,20 +258,20 @@

         wifly.close();

+        autoConnectHost = EEPROM.read(ADDR_HOST_AUTO);
 #ifndef HAYES
         Modem_flowControl = EEPROM.read(ADDR_MODEM_FLOW);
         HandleAutoStart();
 #endif  // HAYES

-        C64Println();
+        //C64Println();
 #ifdef HAYES
-        C64Println(F("Commodore Wi-Fi Modem Hayes Emulation"));
+        C64Println(F("\nCommodore Wi-Fi Modem Hayes Emulation"));
         ShowPETSCIIMode();
         ShowInfo(true);
-        autoConnectHost = EEPROM.read(ADDR_HOST_AUTO);
         HayesEmulationMode();
 #else
-        C64Println(F("Commodore Wi-Fi Modem"));
+        C64Println(F("\nCommodore Wi-Fi Modem"));
         ShowInfo(true);

     while (1)
@@ -278,13 +279,20 @@
         Display(F("READY."));

         ShowPETSCIIMode();
-        C64Println(F("1. Telnet to host or BBS"));
+        C64Print(F("1. Telnet to host or BBS\n"
+                     "2. Phone Book\n"
+                     "3. Wait for incoming connection\n"
+                     "4. Configuration\n"
+                     "\n"
+                     "Select: "));
+
+        /*C64Println(F("1. Telnet to host or BBS"));
         C64Println(F("2. Phone Book"));
         C64Println(F("3. Wait for incoming connection"));
         C64Println(F("4. Configuration"));
         C64Println();
-        C64Print(F("Select: "));
-
+        C64Print(F("Select: "));*/
+
         int option = ReadByte(C64Serial);
         C64Serial.println((char)option);

@@ -301,9 +309,11 @@

                 C64Println();
                 DisplayPhoneBook();
-                C64Print(F("Select: #, m to modify or 0 to go back: "));
+                C64Print(F("\nSelect: #, m to modify, a to set\nauto-start, 0 to go back: "));

                 char addressChar = ReadByte(C64Serial);
+                C64Serial.println((char)addressChar);
+
                 if (addressChar == 'm' || addressChar == 'M')
                 {
                     C64Print(F("\nEntry # to modify? (0 to abort): "));
@@ -331,6 +341,28 @@
                                 updateEEPROMPhoneBook(ADDR_HOSTS + ((phoneBookNumber-1) * ADDR_HOST_SIZE), "");

                         }
+                    }
+                }
+                else if (addressChar == 'a' || addressChar == 'A')
+                {
+                    C64Print(F("\nEntry # to set to auto-start?\n(0 to disable): "));
+
+                    char addressChar = ReadByte(C64Serial);
+
+                    numString[0] = addressChar;
+                    numString[1] = '\0';
+                    int phoneBookNumber = atoi(numString);
+                    if (phoneBookNumber >=0 && phoneBookNumber <= ADDR_HOST_ENTRIES)
+                    {
+                        C64Serial.print(phoneBookNumber);
+                        updateEEPROMByte(ADDR_HOST_AUTO, phoneBookNumber);
+                        /*switch (phoneBookNumber) {
+                            case 0:
+                            break;
+
+                            default:
+                            updateEEPROMByte(ADDR_HOST_AUTO, phoneBookNumber);
+                        }*/
                     }

                 }
@@ -398,20 +430,27 @@
     while (true)
     {
         char temp[30];
-        C64Println();
-        C64Println(F("Configuration Menu"));
-        C64Println();
-        C64Println(F("1. Display Current Configuration"));
-        C64Println(F("2. Change SSID"));
+        C64Print(F("\n"
+                     "Configuration Menu\n"
+                     "\n"
+                     "1. Display Current Configuration\n"
+                     "2. Change SSID\n"));
+//        C64Println();
+//        C64Println(F("Configuration Menu"));
+//        C64Println();
+//        C64Println(F("1. Display Current Configuration"));
+//        C64Println(F("2. Change SSID"));
         sprintf_P(temp,PSTR("3. %s flow control"),Modem_flowControl == true ? "Disable" : "Enable");
         C64Println(temp);
         sprintf_P(temp,PSTR("4. %s DCD always on"),Modem_DCDFollowsRemoteCarrier == false ? "Disable" : "Enable");
         C64Println(temp);
-        C64Println(F("5. Autostart Options"));
-        C64Println(F("6. Direct Terminal Mode (Debug)"));
-        C64Println(F("7. Return to Main Menu"));
-        C64Println();
-        C64Print(F("Select: "));
+        C64Print(F("5. Direct Terminal Mode (Debug)\n"
+                     "6. Return to Main Menu\n"
+                     "\nSelect: "));
+//        C64Println(F("5. Direct Terminal Mode (Debug)"));
+//        C64Println(F("6. Return to Main Menu"));
+//        C64Println();
+//        C64Print(F("Select: "));

         int option = ReadByte(C64Serial);
         C64Serial.println((char)option);
@@ -442,16 +481,13 @@
             updateEEPROMByte(ADDR_MODEM_DCD,Modem_DCDFollowsRemoteCarrier);
             break;

-        case '5': ConfigureAutoStart();
-            break;
-
 /*      case '4': ConfigureBaud();
             break;*/

-        case '6': RawTerminalMode();
+        case '5': RawTerminalMode();
             return;

-        case '7': return;
+        case '6': return;

         case 8:
             SetPETSCIIMode(false);
@@ -478,14 +514,23 @@

     while (true)
     {
-        C64Println();
+        C64Println(F("\n"
+                     "Change SSID\n"
+                     "\n"
+                     "1. WEP\n"
+                     "2. WPA / WPA2\n"
+                     "3. Return to Configuration Menu\n"
+                     "\n"
+                     "Select: "));
+
+/*        C64Println();
         C64Println(F("Change SSID"));
         C64Println();
         C64Println(F("1. WEP"));
         C64Println(F("2. WPA / WPA2"));
         C64Println(F("3. Return to Configuration Menu"));
         C64Println();
-        C64Print(F("Select: "));
+        C64Print(F("Select: "));*/

         int option = ReadByte(C64Serial);
         C64Serial.println((char)option);
@@ -546,14 +591,14 @@
         wifly.leave();
             if (wifly.join(20000))    // 20 second timeout
             {
-                C64Println();
-                C64Println(F("SSID Successfully changed"));
+                //C64Println();
+                C64Println(F("\nSSID Successfully changed"));
                 return;
             }
             else
             {
-                C64Println();
-                C64Println(F("Error joining network"));
+                //C64Println();
+                C64Println(F("\nError joining network"));
                 continue;
             }
     }
@@ -638,7 +683,7 @@
     C64Serial.println();
 }

-inline void C64Println()
+void C64Println()
 {
     C64Serial.println();
 }
@@ -798,8 +843,8 @@
 {
     int localport = wifly.getPort();

-    C64Println();
-    C64Print(F("Incoming port ("));
+    //C64Println();
+    C64Print(F("\nIncoming port ("));
     C64Serial.print(localport);
     C64Print(F("): "));

@@ -814,8 +859,8 @@

     localport = wifly.getPort();

-    C64Println();
-    C64Print(F("Waiting for connection on port "));
+    //C64Println();
+    C64Print(F("\nWaiting for connection on port "));
     C64Serial.println(localport);

     // Idle here until connected
@@ -1212,152 +1257,34 @@
 }

 #ifndef HAYES
-// ----------------------------------------------------------
-// Autoconnect Handling
-
-void ConfigureAutoStart()
-{
-    while (true)
-    {
-        C64Println();
-        C64Print(F("Autostart Menu (Current: "));
-        C64Serial.print(autostart_mode);
-        C64Println(F(")"));
-        C64Println();
-        C64Println(F("0. Clear Autostart Options"));
-#ifdef HAYES
-        C64Println(F("1. Hayes Emulation Mode"));
-        C64Println(F("2. CommodoreServer"));
-//        C64Println(F("3. QuantumLink Reloaded"));
-        C64Println(F("3. Return to Main Menu"));
-#else
-        C64Println(F("1. CommodoreServer"));
-//        C64Println(F("2. QuantumLink Reloaded"));
-        C64Println(F("2. Return to Main Menu"));
-#endif // HAYES
-
-        C64Println();
-        C64Print(F("Select: "));
-
-        int option = ReadByte(C64Serial);
-        C64Serial.println((char)option);
-
-        switch (option)
-        {
-        case '0': autostart_mode = AUTO_NONE;
-            break;
-#ifdef HAYES
-        case '1': autostart_mode = AUTO_HAYES;
-            break;
-
-        case '2': autostart_mode = AUTO_CSERVER;
-            break;
-
-//        case '3': autostart_mode = AUTO_QLINK;
-//            break;
-
-//        case '4': return;
-        case '3': return;
-#else
-        case '1': autostart_mode = AUTO_CSERVER;
-            break;
-
-//        case '2': autostart_mode = AUTO_QLINK;
-//            break;
-
-//        case '3': return;
-        case '2': return;
-#endif // HAYES
-
-        case 8:
-            SetPETSCIIMode(false);
-            continue;
-
-        case 20:
-            SetPETSCIIMode(true);
-            continue;
-
-        case '\n':
-        case '\r':
-        case ' ':
-            continue;
-
-        default: C64Println(F("Unknown option, try again"));
-            continue;
-        }
-
-        updateEEPROMByte(ADDR_AUTOSTART,autostart_mode);
-        C64Println(F("Saved"));
-    }
-}
-#endif // HAYES
-
-#ifndef HAYES
 void HandleAutoStart()
 {
     // Display chosen action

-    switch (autostart_mode)
-    {
-        case AUTO_NONE:  // No Autostart, continue as normal
+    if (autoConnectHost >=1 && autoConnectHost <= ADDR_HOST_ENTRIES)
+    {
+        // Phonebook dial
+        char address[ADDR_HOST_SIZE];
+
+        strncpy(address,readEEPROMPhoneBook(ADDR_HOSTS + ((autoConnectHost-1) * ADDR_HOST_SIZE)).c_str(),ADDR_HOST_SIZE);
+
+        C64Print(F("Auto-connecting to:\n"));
+        C64Println(address);
+
+        C64Println(F("\nPress any key to cancel..."));
+        // Wait for user to cancel
+
+        int option = PeekByte(C64Serial, 2000);
+
+        if (option != TIMEDOUT)   // Key pressed
+        {
+            ReadByte(C64Serial);    // eat character
             return;
-
-#ifdef HAYES
-        case AUTO_HAYES: // Hayes Emulation
-            C64Println(F("Entering Hayes Emulation Mode"));
-            break;
-
-#endif // HAYES
-        case AUTO_CSERVER: // Commodore Server
-            C64Println(F("Connecting to CommodoreServer"));
-            break;
-
-//        case AUTO_QLINK: // QuantumLink Reloaded
-//            C64Println(F("Ready to Connect to QuantumLink Reloaded"));
-//            break;
-
-        default: // Invalid - on first startup or if corrupted.  Clear silently and continue to menu.
-            updateEEPROMByte(ADDR_AUTOSTART,AUTO_NONE);
-            autostart_mode = AUTO_NONE;
-            return;
-    }
-
-    // Wait for user to cancel
-
-    C64Println(F("Press any key to cancel..."));
-
-    int option = PeekByte(C64Serial, 2000);
-
-    if (option != TIMEDOUT)   // Key pressed
-    {
-        ReadByte(C64Serial);    // eat character
-        return;
-    }
-
-    // Take the chosen action
-
-    switch (autostart_mode)
-    {
-#ifdef HAYES
-        case AUTO_HAYES: // Hayes Emulation
-            HayesEmulationMode();
-            break;
-#endif // HAYES
-        case AUTO_CSERVER: // CommodoreServer - just connect repeatedly
-            while (true)
-            {
-                Connect(F("www.commodoreserver.com"), 1541, true);
-                delay(1000);
-            }
-            break;
-
-//        case AUTO_QLINK: // QuantumLink Reloaded
-//            // !!!! Not 100% sure what to do here.  Need 1200 baud.
-//            C64Println(F("TODO: Not Implemented!"));  //  !!!! TODO
-//            return;   // !!!!
-
-        default: // Shouldn't ever reach here.  Just continue to menu if so.
-            return;
+        }
+
+        Modem_Dialout(address);
+        //Connect(F("www.commodoreserver.com"), 1541, true);
+        //delay(1000);
     }
 }
 #endif  // HAYES
@@ -1397,7 +1324,32 @@
     Modem_ResetCommandBuffer();

     C64Println();
-    DisplayBoth(F("OK"));
+
+    if (autoConnectHost >=1 && autoConnectHost <= ADDR_HOST_ENTRIES)
+    {
+        // Phonebook dial
+        char address[ADDR_HOST_SIZE];
+
+        strncpy(address,readEEPROMPhoneBook(ADDR_HOSTS + ((autoConnectHost-1) * ADDR_HOST_SIZE)).c_str(),ADDR_HOST_SIZE);
+
+        C64Print(F("Auto-connecting to:\n"));
+        C64Println(address);
+
+        C64Println(F("\nPress any key to cancel..."));
+        // Wait for user to cancel
+
+        int option = PeekByte(C64Serial, 2000);
+
+        if (option != TIMEDOUT)   // Key pressed
+        {
+            ReadByte(C64Serial);    // eat character
+            DisplayBoth(F("OK"));
+        }
+        else
+            Modem_Dialout(address);
+    }
+    else
+        DisplayBoth(F("OK"));

     while (true)
     {
@@ -2319,16 +2271,6 @@
     //	digitalWrite(DTE_RTS, LOW);
     //}

-    if (autoConnectHost >=1 && autoConnectHost <= ADDR_HOST_ENTRIES && !autoConnectedAtBootAlready)
-    {
-        // Phonebook dial
-        autoConnectedAtBootAlready = 1;
-        char address[ADDR_HOST_SIZE];
-
-        strncpy(address,readEEPROMPhoneBook(ADDR_HOSTS + ((autoConnectHost-1) * ADDR_HOST_SIZE)).c_str(),ADDR_HOST_SIZE);
-        Modem_Dialout(address);
-    }
-
     // Handle all other data arriving on the serial port of the virtual modem.
     Modem_ProcessData();

@@ -2449,7 +2391,7 @@
         EEPROM.write(ADDR_BAUD_HI, b);
 }*/

-void setBaudWiFi(int newBaudRate) {
+void setBaudWiFi(unsigned int newBaudRate) {
   WiFly_BAUD_RATE = newBaudRate;
   WifiSerial.flush();
   delay(2);
@@ -2641,11 +2583,9 @@
         C64Println(readEEPROMPhoneBook(ADDR_HOSTS + (i * ADDR_HOST_SIZE)));
     }
     C64Println();
-#ifdef HAYES
     C64Print(F("Autostart: "));
     C64Serial.print(EEPROM.read(ADDR_HOST_AUTO));
     C64Println();
-#endif
 }

 void Modem_Dialout(char* host)