just got my arduino up and running. no much epxerience in programming.
i am trying to get the example IfstatementConditional to work but i get the folowing error message.
"In function void setup()
error: 'LED' was not declared in this scope"
/*
Conditionals - If statement
created 17 Jan 2009
by Tom Igoe
*/
// These constants won't change:
const int analogPin = 0; // pin that the sensor is attached to
const int ledPin = 13; // pin that the LED is attached to
const int threshold = 400; // an arbitrary threshold level that's in the range of the analog input
void setup() {
// initialize the LED pin as an output:
pinMode(LED, OUTPUT);
// initialize serial communications:
Serial.begin(9600);
}
void loop() {
// read the value of the potentiometer:
int analogValue = analogRead(analogPin);
// if the analog value is high enough, turn on the LED:
if (analogValue > threshold) {
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(ledPin,LOW);
}
// print the analog value:
Serial.println(analogValue, DEC);