Impossible bug

I’ve been a programmer for quite a while and seen some really stupid things.

But this takes the biscuit.

//Inclue Libraries we need
#include <LiquidCrystal.h>

LiquidCrystal lcd(8, 9, 4, 5, 6, 7); //Tell the library how our LCD is connected
int backLightControl = 10;   // Identify pin connection for back light transistor on LCD


//This is called by the Arduino to initialise the system
void setup() {
  lcd.begin(16,2);          //Tell the Library how many characters and lines we have
 }

void loop() {

  lcd.setCursor(0,0);       //Character 0  FIRST line
  lcd.print("Line One");
  lcd.setCursor(0,1);       //Character 0  SECOND line.
  lcd.print("Line Two !!");
//  lcd.print("Line Two !!!"); //this causes programmer and LCD to CRASH!!!
  
}

The code works perfectly Until, I comment out " lcd.print(“Line Two !!”);" and replace it with " lcd.print(“Line Two !!!”);"

Whenever there are three !'s the programmer & the Arduino crashes, see attachments,
This occurs under windows and OS X

pic1.tiff (54.5 KB)

pic2.tiff (70.5 KB)

This rings a bell. I think in older versions of the newer Uno design the special sequence '!!!' was used to put the USB chip into some kind of monitor or debug mode. This is similar to how the old Hayes-style modems used '+++' as a special sequence to get out of data mode and go into command mode. In fact, XBee's do the same thing come to think of it.

Easiest solution: don't do that :slight_smile:

Either that or upgrade to the newer version of the USB firmware, which took this behavior out.

--
The Ruggeduino: compatible with Arduino UNO, 24V operation, all I/O's fused and protected

Yep,
I suspected either a compiler or chip caveat escape sequence, but it wasted me nearly a day in checking cables, libraries and even at one stage suspected the LCD as being defective.

Problem is, that if I need to re-program the internal firmware it requires additional hardware such as a USBTINY, I'd been looking at selling shields, and this is exactly the kind of thing that causes returns and disputes with Paypal.

http://code.google.com/p/arduino/issues/detail?id=392

How could the arduino team not put this on their front page? Don't get too excited with three '!' anywhere. It's easy to update the serial.print documentation and else to point this out. Thanks OP for mentioning this and everyone else explaining it. Anything else that are along the same direction? I'm using escape sequences to drive my serial LCD so I can't afford to see arduino folks take away things, say the escape \e, and use it for their own stuff.