I have adjusted the forum so it should be easier to read now.I also made a change to the code that concerns the push button but now I am getting a error.
'buttonState' does not name a type
int redLED = 8;
int redOnTime = 250;
int redOffTime = 250;
int yellowButton = 2;
int tempPin = A0;
void setup() {
Serial.begin(9600);
pinMode(redLED, OUTPUT);
pinMode(yellowButton, INPUT);
}
void loop()
{
float voltage, degreesC, degreesF;
voltage = getVoltage(tempPin);
degreesC = (voltage - .5) * 100;
degreesF = degreesC * (9 / 5) + 32;
Serial.print("voltage: ");
Serial.print(voltage);
Serial.print(" deg C: ");
Serial.print(degreesC);
Serial.print(" deg F: ");
Serial.println(degreesF);
delay(1000);
}
int buttonState;
buttonState = digitalRead(yellowButton);
if (buttonState == LOW)
{
digitalWrite(redLED, HIGH);
}
float getVoltage(int pin)
{
return (analogRead(pin) * 0.004882814);
}