Error compiling for board Arduino/Genuino Uno.

This code is saying:

Arduino: 1.8.5 (Windows 8.1), Board: "Arduino/Genuino Uno"

c:/program files (x86)/arduino/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/lib/avr5/crtatmega328p.o:(.init9+0x0): undefined reference to `main'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Can someone please halp me fix this thanks

Try closing all Arduino IDE windows and then restart the Arduino IDE. This will clear the cache and hopefully solve the problem.

Thanks a lot pert it got cleared but then said :
sketch_may13b:19: error: expected constructor, destructor, or type conversion before ‘(’ token

pinMode (pResistor, INPUT);

^

sketch_may13b:20: error: expected declaration before ‘}’ token

}

^

exit status 1
expected constructor, destructor, or type conversion before ‘(’ token

Here is the code:

void setup() {

const int pResistor = A0;
const int ledPin=9;

int value;

void setup();

pinMode(ledPin, OUTPUT);
}
pinMode (pResistor, INPUT); <— the error came here
}

{ void loop();
value = analogRead(pResistor);

if (value > 25){
digitalWrite(ledPin, LOW);
}
else{
digitalWrite(ledPin, HIGH);
}

delay(500);
}
}

That's a mess! You need to pay much closer attention to what you are cutting & pasting. As with all code languages, in C, every bracket and semicolon must be exactly right. You can't just scatter them about and hope for the best.

I corrected it for you. This is how you post code on the forum:

const int pResistor = A0;
const int ledPin = 9;


int value;

void setup() {

  pinMode(ledPin, OUTPUT);
  pinMode (pResistor, INPUT);
}

void loop() {

  value = analogRead(pResistor);

  if (value > 25) {
    digitalWrite(ledPin, LOW);
  }
  else {
    digitalWrite(ledPin, HIGH);
  }

  delay(500);
}

THANKS a lot Paul but how do i add another led bulb to it i will give you the link to where i got it:

can you try at least to show me how to add three led bulbs that would be very helpful because im trying to make it again oh yeah and here is the code again:

[const int pResistor = A0;
const int ledPin = 9;


int value;

void setup() {

  pinMode(ledPin, OUTPUT);
  pinMode (pResistor, INPUT);
}

void loop() {

  value = analogRead(pResistor);

  if (value > 25) {
    digitalWrite(ledPin, LOW);
  }
  else {
    digitalWrite(ledPin, HIGH);
  }

  delay(500);
}]

thanks for all the help!

I’m sorry but I do not want waste my time trying to help you do this. You clearly do not have the aptitude for coding. You should choose another hobby. Your last post demonstrates this in several ways.

[const int pResistor = A0;

This line will give an error because of the [

}]

This line will give an error because of the ]

thanks for all the help!

This line will also give errors. I know you did not intend for that line to be part of your code, but you did put it inside the code tags. This shows that you are too careless and you do not check your work.

You ask about adding more “bulbs” but you failed to explain what you want the “bulbs” to do. Bulbs are not the same as LEDs, but i understand that could be a translation error.