LiquidCrystal

Hi, I wanted to change this code, so I wouldn't be bothered with the loop. So I tryed this:

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("hello, world!"); }

void loop() { // set the cursor to column 0, line 1 // (note: line 1 is the second row, since counting begins with 0): lcd.setCursor(0, 1); // print the number of seconds since reset: lcd.print(millis()/1000); }

I just removed the loop, hoping to read "hello, world" on the first line, but get a compile error, saying "undefined reference to loop".

void setup() { // set up the LCD's number of columns and rows: lcd.begin(16, 2); // Print a message to the LCD. lcd.print("hello, world!"); }

Why can't I just remove that part?

Thanks in advance.

The compiler needs the loop() function. If you don't want to do anything in it the use:- void loop() { }