error message, weather station (HELP)

I need help with this, i'm trying to make a weather station with Ethernet and the program runs good, temperature humidity, water level but not the windspeed, so i wonder if you could help me.

here is the program

// Incluimos librerías
#include <math.h>
#include <SPI.h>
#include <Ethernet.h>
#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT11
#define WindSensorPin (3)
DHT dht(DHTPIN, DHTTYPE);

const int read = A0; //Sensor AO pin to Arduino pin A0
int value; //Variable to store the incomming data

volatile unsigned long Rotations; // cup rotation counter used in interrupt routine
volatile unsigned long ContactBounceTime; // Timer to avoid contact bounce in interrupt routine

float WindSpeed; // speed miles per hour

//Declaración de la direcciones MAC e IP. También del puerto 80
byte mac[]={0xDE,0xAD,0xBE,0xEF,0xFE,0xED}; //MAC
IPAddress ip(192,168,1,15); //IP
EthernetServer servidor(80);
String readString=String(30);

void setup() {
Ethernet.begin(mac, ip); //Inicializamos con las direcciones asignadas
servidor.begin();
Serial.print("server is at ");
Serial.println(Ethernet.localIP());
Serial.begin(9600);
dht.begin();
{
pinMode(WindSensorPin, INPUT);
attachInterrupt(digitalPinToInterrupt(WindSensorPin), rotation, FALLING);

Serial.println("Wind Speed Test");
Serial.println("Rotations\tMPH");

}
}

void loop() {

EthernetClient cliente= servidor.available();
if(cliente) {
boolean lineaenblanco=true;
while(cliente.connected()) {

if(cliente.available()) {
char c=cliente.read();
Serial.write(c);
if (c == '\n' && lineaenblanco) {

value = analogRead(read); //Read data from analog pin and store it to value variable

cliente.println("HTTP/1.1 200 OK");
cliente.println("Content-Type: text/html");
cliente.println("Connection: close"); // the connection will be closed after completion of the response
cliente.println("Refresh: 5"); // refresh the page automatically every 5 sec
cliente.println();
cliente.println("");
cliente.println("");
// output the value of each analog input pin
cliente.println("");
cliente.print("Protipo Para Monitoreo De Variables Meteorológicas ");
cliente.println("
");
cliente.println("
");

if(readString.length()<30) {
readString.concat(c);
//Cliente conectado
//Leemos petición HTTP caracter a caracter
//Almacenar los caracteres en la variable readString
}
if(c=='\n' && lineaenblanco) //Si la petición HTTP ha finalizado
{

int h = dht.readHumidity();// Lee la humedad
int t= dht.readTemperature();//Lee la temperatura

cliente.println("");
//Humedad
cliente.println("

");
cliente.println ("");
cliente.println("");
cliente.println("");
cliente.println("");
cliente.println("");
cliente.println("");
delay (500);

//Temperatura
cliente.println ("

");
cliente.println("");
cliente.println("");
cliente.println("");
cliente.println("");
delay (500);

//Pluviometro
if (value<=480){
cliente.println("

");
cliente.println("");

}
else if (value>480 && value<=530){
cliente.println("

");
cliente.println("");
}
else if (value>530 && value<=615){
cliente.println("");
cliente.println("");
}
else if (value>615 && value<=660){
cliente.println("");
cliente.println("");
}
else if (value>660 && value<=680){
cliente.println("");
cliente.println("");
}
else if (value>680 && value<=690){
cliente.println("");
cliente.println("");
}
else if (value>690 && value<=700){
cliente.println("");
cliente.println("");
}
else if (value>700 && value<=705){
cliente.println("");
cliente.println("");
}
else if (value>705){
cliente.println("");
cliente.println("");
}

delay(500); // Check for new value every 5 sec

//Velocidad del viento MPH

Rotations = 0; // Set Rotations count to 0 ready for calculations

sei(); // Enables interrupts
delay (3000); // Wait 3 seconds to average
cli(); // Disable interrupts

// convert to mp/h using the formula V=P(2.25/T)
// V = P(2.25/3) = P * 0.75

WindSpeed = Rotations * 0.75;

cliente.print(Rotations);
cliente.print("\t\t");
cliente.println(WindSpeed);

// This is the function that the interrupt calls to increment the rotation count
void rotation () {
{
if ((millis() - ContactBounceTime) > 15 ) { // debounce the switch contact.
Rotations++;
ContactBounceTime = millis();
}

}

}

cliente.stop();
//Cierro conexión con el cliente
readString="";
}
}
}
}

the error message is this: In function 'void setup()':

sketch_nov22b:38: error: 'rotation' was not declared in this scope

attachInterrupt(digitalPinToInterrupt(WindSensorPin), rotation, FALLING);

^
and this:

In function 'void loop()':

sketch_nov22b:235: error: expected '}' at end of input

and this:

exit status 1
'rotation' was not declared in this scope

");
cliente.print("Humedad Relativa: ");
cliente.println("
");
cliente.print(h);//Escribe la humedad
cliente.println(" %");
cliente.println("
");
cliente.print("Temperatura: ");
cliente.println("
");
cliente.print(t);//Escribe la temperatura
cliente.println(" C'");
cliente.println("
");
cliente.println("Water level");
cliente.println("
");
cliente.println("Empty!");
cliente.println("
");
cliente.println("Water level");
cliente.println("
");
cliente.println("0mm to 5mm");
cliente.println("
");
cliente.println("Water level");
cliente.println("
");
cliente.println("5mm to 10mm");
cliente.println("
");
cliente.println("Water level");
cliente.println("
");
cliente.println("10mm to 15mm");
cliente.println("
");
cliente.println("Water level");
cliente.println("
");
cliente.println("15mm to 20mm");
cliente.println("
");
cliente.println("Water level");
cliente.println("
");
cliente.println("20mm to 25mm");
cliente.println("
");
cliente.println("Water level");
cliente.println("
");
cliente.println("25mm to 30mm");
cliente.println("
");
cliente.println("Water level");
cliente.println("
");
cliente.println("30mm to 35mm");
cliente.println("
");
cliente.println("Water level");
cliente.println("
");
cliente.println("35mm to 40mm");
cliente.println("

The variable you defined is called Rotation, not rotation - C++ is case sensitive.

EDIT - ignore that, it's wrong. I didn't spot that your variable is Rotations and your function is rotation()

I think if you get your {} braces sorted, then rotation() will be defined properly and things should work.

Try adding a } after cliente.println(WindSpeed);

Now i got this error message:

In function 'void loop()':

sketch_nov22b:217: error: a function-definition is not allowed here before '{' token

void rotation () {

^

sketch_nov22b:235: error: expected '}' at end of input

}

^

sketch_nov22b:235: error: expected '}' at end of input

sketch_nov22b:235: error: expected '}' at end of input

sketch_nov22b:235: error: expected '}' at end of input

sketch_nov22b:235: error: expected '}' at end of input

sketch_nov22b:235: error: expected '}' at end of input

GypsumFantastic:
The variable you defined is called Rotation, not rotation - C++ is case sensitive.

That is not the problem

    attachInterrupt(digitalPinToInterrupt(WindSensorPin), rotation, FALLING);

attachInterrupt() takes the name of a function, not a variable.

However, there is plenty else wrong with the code. Once formatted using AutoFormat in the IDE the fact that the loop() function has no closing brace will become obvious.

That also looks like the kind of error reported when a function is written inside another function, such as loop:

void loop(){
  void rotation() {
  //
  }
}

should be

void loop(){
//
}
void rotation() {
//
}

Thank you so much! it finally works, really thank you so much :smiley: