AAC Keys resets Arduino Uno

Hi all, new to the forums. I've had a search around and haven't been able to find anything like this occurring elsewhere.

I'm trying to send a simple command to my PC (Windows 7) via arduino and AAC Keys.
For some reason which I cannot determine, whenever I send a command from the arduino it resets itself. It happens before the whole command is able to be sent to the PC. I suspect that AAC keys might be sending something back that is causing this to happen, as when I run the sketch without AAC Keys open, and just use the Serial Monitor from the Arduino IDE the string comes through fine.

Simplified sketch is below, and includes a counter to be sure that the sketch is not restarting.

  int buttonPin = 3;                   //using digital pin 3
  int i=0;                             //counter to monitor is we are restarting arduino or not
void setup() {
  Serial.begin(9600);
}
void loop() {
  if(digitalRead(buttonPin) == HIGH){  //1 kOhm pull down resistor used, 240 Ohm on 5 V line to protect pins
    Serial.print("hello world");       //what we want to print
    Serial.println(i);                 //counter. if we are not restarting, counts up, else, stays at 0
    i++;
    delay(300);                        //debouncing
  }
}

Any help would be great. I've considered using gobetweeno, but don't like giving up on problems...

You should post the code that fails.

My Mega will reboot if I overflow an array, like putting 80 characters into a 64 byte array. Maybe your program is doing the same thing.

Sorry, I wasn't quite clear.
The posted code does fail. When I use the serial monitor, all is fine, but when I open up AAC Keys it resets each time. After some reading I have placed a 10 nanofarad capacitor across ground and reset, and this has stopped it from resetting each time, so The problem there was with the DTR signal going to LOW.

After that the GIDEI commands still cam through garled, and yes, it was all for want of a missing comma. sign

Thanks for the help Tim.