Go Down

Topic: Love-O-Meter (Read 983 times) previous topic - next topic


     const int sensorPin = A0;
     const float baselineTemp = 20.0;
     void setup() {
       for(int pinNumber = 2; pinNumber<5; pinNumber++){
         pinMode(pinNumber, OUTPUT);
         digitalWrite(pinNumber, LOW);
     void loop(){
       int sensorVal= analogRead(sensorPin);
       Serial.print("Sensor Value:");
       float voltage = (sensorVal/1024.0)* 5.0;
       Serial.print(", degrees C:");
       float temperature = (voltage-.5)* 100);
       else if(temperature >= baselineTemp+2 && temperature < baselineTemp+4){
   digitalWrite(2, HIGH);
digitalWrite(3, LOW);
       }else if (temperature >= baselineTemp+4 && temperature < baselineTemp+6){
       }else if (temperature >= baselineTemp+6){
         The de-bugger states that in line 20 there should be another ; before the ) token, yet all semi-colons are in place, please help


A } is missing before the first else if.

Go Up