Compilation Failed Please Report

Hi, i have the sme problem. this skecth work very well on arduino desktop, but not work on web editor

please, i need some hints
thank you

// this is the skect for sensor MQ7
// Digital pin 9 will be called 'pin8'
int pin9 = 9;
// Analog pin 0 will be called 'sensor'
int sensor = A0;
// Set the initial sensorValue to 0
int sensorValue = 0;

// The setup routine runs once when you press reset
void setup() {
// Initialize the digital pin 8 as an output
pinMode(pin9, OUTPUT);
// Initialize serial communication at 9600 bits per second
Serial.begin(9600);
}

// The loop routine runs over and over again forever
void loop() {
// Read the input on analog pin 0 (named 'sensor')
sensorValue = analogRead(sensor);
// Print out the value you read
Serial.println(sensorValue, DEC);
// If sensorValue is greater than 500
if (sensorValue > 500) {
// Activate digital output pin 8 - the LED will light up
digitalWrite(pin9, HIGH);
}
else {
// Deactivate digital output pin 8 - the LED will not light up
digitalWrite(pin9, LOW);
}

Please dont just jump into other peoples posts.
Might I suggest you read the forum rules.

BTW you are simply missing a bracket to get it to compile.
Works here *with the required bracket"

Hi,
i am sorry, I am new in this. I will read it the fourum rules!!

in other hand, I missed to copy the whole code, it include the braket :frowning: however It does not run
this is the online code

any help?

// Digital pin 9 will be called 'pin8'
int pin9 = 9;
// Analog pin 0 will be called 'sensor'
int sensor = A0;
// Set the initial sensorValue to 0
int sensorValue = 0;

// The setup routine runs once when you press reset
void setup() {
// Initialize the digital pin 8 as an output
pinMode(pin9, OUTPUT);
// Initialize serial communication at 9600 bits per second
Serial.begin(9600);
}

// The loop routine runs over and over again forever
void loop() {
// Read the input on analog pin 0 (named 'sensor')
sensorValue = analogRead(sensor);
// Print out the value you read
Serial.println(sensorValue, DEC);
// If sensorValue is greater than 500
if (sensorValue > 500) {
// Activate digital output pin 9 - the LED will light up
digitalWrite(pin9, HIGH);
}
else {
// Deactivate digital output pin 9 - the LED will not light up
digitalWrite(pin9, LOW);
}

}

I compiled the code in the CREATE editor and it compiled just fine.

Do you mean it will not upload ?
If so what are the error messages you see in the lower console ?