Errors in Declaring Variables:First Arduino Assignment

Hi,
I'm using a tmp36 sensor and 3 LED to show temperature changes in degrees Celsius and Fahrenheit. This is my first time exposed to coding and arduino and I have done the Blink assignment but this one is a little more complex for me. I think I have the structure correct but I keep getting errors like initializer expected before "C" or did not define C but I already looked up examples and the arduino forum and none have these defined in the setup. Any help at all or guidance towards a similar code to mine would be of great help.
This is my code

void setup()
{
  int temperaturePin= A0;    // This is my pin with the sensor
  int ledPin1 = 9;          // Pin with Led 1
  int ledPin2 = 10;              // Pin with Led 2
  int ledPin3 = 11;              // Pin with Led3
  pinMode(ledPin1,OUTPUT);    // will outpute voltage value for pin 1
  pinMode(ledPin2,OUTPUT);    // will output voltage for pin2
  pinMode(ledPin3,OUTPUT);    // will ouput voltage for pin3
  int base= 20;

  }
  
  void loop ()                // will run over and over again 
  {
  float voltage ;
  Serial.print(voltage);
  Serial.println("voltage");
 degrees C= (voltage-0.5)*100;    // converts voltage to celsius
  float degrees C=20 ;
  Serial.print("degrees C");
  Serial.println(degrees C);
  degrees F= (degrees*9.0/5.0)+32;  //converts to Farenheit
  float degrees F;
  Serial.print(degrees F);
  Serial.println("degrees F");
  
  if (degrees C > base && degrees C< base +2 );
  {
    digitalWrite(ledPin1,HIGH);
    digitalWrite(ledPin2,LOW);
    digitalWrite(ledPin3,LOW);
  }
  else if(degrees C> base +2 && degrees C < base+4 );
  {  
    digitalWrite(ledPin1,HIGH);
    digitalWrite(ledPin2,HIGH);
    digitalWrite(ledPin3,LOW);
  }
  else if (degrees C >= base+4 && < base+6 )
  {
    digitalWrite(ledPin1,HIGH);
    digitalWrite(ledPin2,HIGH);
    digitalWrite(ledPin3,HIGH);
   }
  float getVoltage( int temperaturePin)
  {  
    return(int temperaturePin * 0.0048);
   delay(2000);
  }
  }

Thank you for even looking at this post!

You can't have spaces in variable names like this:
degrees C
degrees F

every time you re-declare a variable, I'm pretty sure its value becomes 0:
float voltage ;
Missing something to compare against in this one:
else if (degrees C >= base+4 && ______ < base+6 )

You never analogRead(A0) so your sensor is never read.

Few things to fix up :slight_smile:

Hi!
Thank you so much! I'm still trying to get familiar these terms and so you helped clarify this .

Thanks!

Learn by doing, good way to pick things up.

Thanks! :slight_smile: For a newbie like me, great advice.

void setup()
{
  int temperaturePin= A0;    // This is my pin with the sensor
  int ledPin1 = 9;          // Pin with Led 1
  int ledPin2 = 10;              // Pin with Led 2
  int ledPin3 = 11;              // Pin with Led3
  pinMode(ledPin1,OUTPUT);    // will outpute voltage value for pin 1
  pinMode(ledPin2,OUTPUT);    // will output voltage for pin2
  pinMode(ledPin3,OUTPUT);    // will ouput voltage for pin3
  int base= 20;

  }

variables like ledPin1 etc, declared inside a function (here the ffunction is setup()) will not be visible in other functions, like loop().
This concept is known as "scope"