Hello, Can someone help me out. I just started programming my Arduino Uno micro controller and anytime I try to verify or download the program I get this errors :
sketch_sep_Test2.ino:9:2: error: 'Serial' does not name a type
sketch_sep_Test2.ino:13:1: error: expected declaration before '}' token
below is the program:
const int sensorPin = A0;
const float baselineTemp = 20.0;
void setup();
// open serial port
Serial.begin(9600);
}for(int pinNumber = 2; pinNumbers<5; pinNumber++){
pinMode(pinNumer,OUTPUT);
digitalWrite(PinNumber, LOW);
}
}
void loop(){;
int sensorVval = analogRead(sensorPin);
Serial.print("Sensor Value: ")
Serial.print(sensorVal);
//convert the ADC reading to voltage
float voltage = (sensorVal/1024.0)*5.0;
Serial.print(", Volts:")
Sserial.print(voltage);
Serial.print(",degrees C:");
// convert the voltage to temperature in degrees
float temperature = (voltage - .5)*100;
Serial.println(temperature);
if(temperature < baselineTemp){
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
}else if(temperature>=baselineTemp+2 &&
temperature<baselineTemp+4){
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
}else if(temperature>=baselineTemp+4 &&
temperature<baselineTemp+6){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
}else if(temperature >=baselineTemp+6){
digitalWrite(2, HIGH);
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
delay(1);
}
and I have the same error for this one as well. Thank you for your help.
void setup()
// put your setup code here, to run once:
;
}
void loop() {
// put your main code here, to run repeatedly:
;
}
int switchState = 0;
void setup() {
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(2, OUTPUT);
}
void loop() {
switchState = digitalRead(2);
// this is a comment
if (switchState == LOW) {
// THE BUTTON IS NOT PRESSED
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
;
}
else { // the button is pressed
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digitalWrite(5, HIGH);
delay(250);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
delay(250);
};
}