Академический Документы
Профессиональный Документы
Культура Документы
void loop() {
// initialize output mode for LED
pinMode(7, OUTPUT);
pinMode(turnoff, INPUT_PULLUP);
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
float voltage = sensorValue * (15.0 / 1023.0);
// print out the value you read:
Serial.println(voltage);
delay(1000);
while(var<1) {
Serial.println(voltage);
buzz(200); //warns the user the noodle is already cooked
delay(20);
if (digitalRead(turnoff) == LOW) { //program detects the reset button is pressed
analogWrite(buzzpin,0); // turn off the buzzer
digitalWrite(7, LOW); // turn the LED off by making the voltage LOW
// delay to ensure the thermocouple has already cooled down from the heat
delay(30*1000);//30 second delay 2 minutes delay were
delay(30*1000); //30 second delay introduced to ensure the
thermocouple have cooled
delay(30*1000); //30 second delay down sufficiently from intense
heat induced from the noodle
delay(30*1000); //30 second delay
cup
break;
}
}
delay(2000); //stablilize buzzer
{
analogWrite(buzzpin,20); // produce sound to buzzer
digitalWrite(7, HIGH); // turn the LED on (HIGH is the voltage level)
delay(time);
analogWrite(buzzpin,0); // turn off the buzzer
digitalWrite(7, LOW); // turn the LED off by making the voltage LOW
delay(time);
}
//end of program