Commit 38b5bbef authored by Doaa Allshureih's avatar Doaa Allshureih

edit

parent 26b7919e
Pipeline #166580 passed with stage
in 16 seconds
<div id="Doaa .AlShureih" class="navbar navbar-default navbar-static-top" role="navigation">
<div id="Doaa .AlShureih" class="navbar navbar-default navbar-static-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header"><a class="navbar-brand" href="#Doaa.Alshureih">Doaa .S AllShureih</a>
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-menubuilder"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
......@@ -220,6 +220,7 @@ int smokeA0 = A0;
// Your threshold value
int sensorThres = 400;
void setup() {
pinMode(blueLed, OUTPUT);
pinMode(buzzer, OUTPUT);
......@@ -230,6 +231,7 @@ void setup() {
void loop() {
int analogSensor = analogRead(smokeA0);
Serial.print("Pin A0: ");
Serial.println(analogSensor);
// Checks if it has reached the threshold value
......@@ -237,12 +239,14 @@ void loop() {
{
digitalWrite(blueLed, HIGH);
tone(buzzer, 5, 4000);
Serial.println("GAS");
}
else
{
digitalWrite(blueLed, LOW);
noTone(buzzer);
Serial.println("NO GAS");
}
delay(100);
}
......@@ -311,4 +315,4 @@ This week I should add a sensor to a microcontroller board that I had design it
</p>
</body>
</html>
</html>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment