Please Subscribe My YouTube Channel

Showing posts with label Viva O Level. Show all posts
Showing posts with label Viva O Level. Show all posts

Monday, February 03, 2025

Program No 4- Gas Detect Arduino Program #Howto #Youtube #ITCIComputerHa...




int red=6; 
int green=4;
int yellow=5;
int sensgas=A0;
int speak=2;
void setup() 
{
  Serial.begin(9600); //Used for serial communication b/w sensor and arduino board 
  pinMode(red,  OUTPUT);
  pinMode(green,  OUTPUT);
  pinMode(yellow,  OUTPUT);
  pinMode(speak,  OUTPUT);
  
}
void  loop() 
{
  int data_sensor = analogRead(sensgas);
  Serial.print("Detect Voltage Level:");
  Serial.println(data_sensor);
  
  if (data_sensor ==20){
  digitalWrite(green, HIGH);
  digitalWrite(yellow, LOW);
  digitalWrite(red, LOW);
  digitalWrite(speak, LOW);
  noTone(speak);
  }
  else if ((data_sensor >20) && (data_sensor <30)){
   digitalWrite(green, LOW);
   digitalWrite(yellow, HIGH);
   digitalWrite(red, LOW);
   digitalWrite(speak, LOW);
   noTone(speak);
  }
  else {
   digitalWrite(green, LOW);
   digitalWrite(yellow, LOW);
   digitalWrite(red, HIGH);
   digitalWrite(speak, HIGH);
   tone(speak,1000);
  }

 




Monday, January 15, 2024

All Full Form for O level Viva & Practical with Explanation



All Full Form For O level Viva & Practical