Error compiling.

This is my problem:

core.a(main.cpp.o): In function main': D:\Arduino\hardware\arduino\cores\arduino/main.cpp:11: undefined reference to setup'

This is my source code:

#include <LiquidCrystal.h>
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);
byte sensorPin[] = {8, 9, 10};
byte ledPin[] = {11, 12, 13}; // NUMBER of leds = numbers of sensors
const byte sensors = 3;
int level = 0; 
 
void SETUP() {
  for(int i = 0; i < sensors; i++) {
     pinMode(sensorPin[i], INPUT); 
     pinMode(ledPin[i], OUTPUT);
  }
 
  lcd.begin(16, 2);   
}
 
void loop() {
  level = 0; 
  for(int i = 0; i < sensors; i++) {
     if(digitalRead(sensorPin[i]) == LOW) {
        digitalWrite(ledPin[i], HIGH);
        level = sensors - i;
     } else {
       digitalWrite(ledPin[i], LOW);       
     }    
  }
  lcd.clear();
  lcd.print("Water level");
  lcd.setCursor(0,1);  
  switch(level) {
     case 1:
      lcd.print("HIGH");
      
      break;
     case 2:
       lcd.print("AVERAGE");
       
       break;
     case 3:
       lcd.print("LOW");
       
       break;
     default:
      lcd.print("NO WATER"); 
     
      break;
  }
  delay(50);  
 }

moderator: added code tags

Hi, welcome to the forum.

You have "SETUP" and the compiler can find "setup". Rename it :slight_smile: This is 'c' and 'c++', not Basic.

When an item of an array is selected, use index with '[' and ']'.
For example the use the array sensorPin and ledPin :

  for(int i = 0; i < sensors; i++) {
     pinMode(sensorPin[i], INPUT);
     pinMode(ledPin[i], OUTPUT);
  }