test
file_1st_skirpsi.ino (569 Bytes)
A small file like that can be placed in-line in your post Please use code tags when you do so.
sterretje:
A small file like that can be placed in-line in your postPlease use code tags when you do so.
ah yeah sorry I just know about using code tags, thanks anyway
eizan:
test
Fail.
Here is your code in code tags with the error pointed out with a comment. I leave it to you to fix the warnings.
float temp;
int tempPin = 0;
int buzzer = 8; // buzz positive to digital pin 8
void setup()
{
pinMode (buzzer, OUTPUT);
Serial.begin(9600);
beep(500);
}
void loop()
{
temp = analogRead(tempPin);
temp = temp * 0.48828125;
Serial.print("Temp = ");
Serial.print(temp);
Serial.print("*C");
Serial.println();
delay(1000);
if (temp > 33 ) {
beep(50);
beep(50);
}
} // inserted missing curly bracket to close loop() function
void beep(unsigned char delayms) {
digitalWrite(buzzer, HIGH);
delay(delayms); // wait for a delayms ms
digitalWrite(buzzer, LOW);
delay(delayms); // wait for a delayms ms
}