I need help developing a new program.

void main(){


const int ledpin = 13
const int analog_in = A0
const int min_sensorvalue = 0
const int max_sensorvalue = 2000
int sensorvalue = 0

}

void setup( ){
}

void loop( ){
  sensorvalue = analogRead(analog_in)
  if(sensorvalue > max_sensorvalue){
    sensorvalue = max_sensorvalue
  }
  else if(sensorvalue < min_sensorvalue){
    sensorvalue = min_sensorvalue
  }
  digitalWrite(ledpin, HIGH)
  delay(sensorvalue)
  digitalWrite(ledpin, LOW)
}

I keep getting a ton of error messages when I compile it

update moderatore: replaced quotes with code tags + fixed copy error

BlinkSpeed.ino (459 Bytes)

Do you have question ?
Do you have a complete program by any chance ?
Did you mean to have a main() function or was that just an accident ?
Have you read Read this before posting a programming question ... - Programming Questions - Arduino Forum ?

Senor value can only be max of 1023.

digitalWrite(ledpin, [color=#00 ???

the attached ino file is correct , I'll fix the original Post

(deleted)

UKHeliBob:
Do you have question ?
Do you have a complete program by any chance ?
Did you mean to have a main() function or was that just an accident ?
Have you read Read this before posting a programming question ... - Programming Questions - Arduino Forum ?

no, I didn't mean to have a main() function.

no, I didn't mean to have a main() function.

Then I am intrigued as to why it was there. As has been suggested you should look at some of the examples to see how an Arduino 'sketch' (horrible word !) is constructed. You can have a main() function if you want but it is normally added invisibly behind the scenes when compiling from the IDE.