0% found this document useful (0 votes)
25 views2 pages

Coding Arduino

The document defines variables for an LCD screen, gas sensor, LEDs, and speaker. It sets up the LCD to display text and the pins for input and output. The main loop reads the gas sensor and displays/plays output based on the sensor reading.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views2 pages

Coding Arduino

The document defines variables for an LCD screen, gas sensor, LEDs, and speaker. It sets up the LCD to display text and the pins for input and output. The main loop reads the gas sensor and displays/plays output based on the sensor reading.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include <LiquidCrystal.

h>

LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

int Gas = 7;

int redLed = 6;

int greenLed = 5;

int speaker = 4;

void setup()

lcd.begin(20, 4);

lcd.setCursor(0,0);

lcd.print("Gas Detected :");

lcd.setCursor(1,2);

lcd.print("Aminatussaadah");

lcd.setCursor(4,3);

lcd.print("Elektronika Digital");

pinMode(Gas , INPUT);

pinMode(redLed, OUTPUT);

pinMode(greenLed, OUTPUT);

pinMode(speaker, OUTPUT);

void loop()

if(digitalRead(Gas) == HIGH)

{lcd.setCursor(14,0);lcd.print(" Yes");

digitalWrite(redLed, HIGH);

digitalWrite(greenLed, LOW);

digitalWrite(speaker, HIGH);}
if(digitalRead(Gas) == LOW)

{lcd.setCursor(14,0);lcd.print(" No ");

digitalWrite(redLed, LOW);

digitalWrite(greenLed, HIGH);

digitalWrite(speaker, LOW);}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy