際際滷

際際滷Share a Scribd company logo
const intEchoPin1= 2;
const intTriggerPin1= 3;
const intEchoPin2= 4;
const intTriggerPin2= 5;
const intEchoPin3= 6;
const intTriggerPin3= 7;
voidsetup() {
Serial.begin(9600);
pinMode(TriggerPin1,OUTPUT);//paralas secadorasdisparadordel ultrasonico
pinMode(EchoPin1,INPUT);//paralassecadorasecodel ultrasonico
pinMode(TriggerPin2,OUTPUT);//paraapagar losmotoresdisparadordel ultrasonico
pinMode(EchoPin2,INPUT); //paraapagarlos motoresecodel ultrasonico
pinMode(TriggerPin3,OUTPUT);//paraencenderlosmotoresdisparadordel ultrasonico
pinMode(EchoPin3,INPUT);//paraencenderlosmotoresECOdel ultrasonico
pinMode(8,OUTPUT);//pinde losmotores
pinMode(9,OUTPUT);//secadoras
digitalWrite(8,LOW);//apagados
digitalWrite(9,LOW);//apagados
}
voidloop() {
intcm1 = ping(TriggerPin3,EchoPin3);
if (cm1>2 && cm1<15)
digitalWrite(8,HIGH);
intcm2 = ping(TriggerPin2,EchoPin2);
if (cm2>2 && cm2<15)
{
digitalWrite(8,LOW);
}
int cm3 = ping(TriggerPin1,EchoPin1);
if (cm3>2 && cm3<15)
{
digitalWrite(8,LOW);
digitalWrite(9,HIGH);
Serial.print("Distancia:");
Serial.println(cm3);
}
else
{
digitalWrite(9,LOW);
}
}
intping(intTriggerPin,intEchoPin) {
longduration,distanceCm;
digitalWrite(TriggerPin,LOW); //paragenerarunpulsolimpioponemosaLOW 4us
delayMicroseconds(4);
digitalWrite(TriggerPin,HIGH); //generamosTrigger(disparo) de 10us
delayMicroseconds(10);
digitalWrite(TriggerPin,LOW);
duration= pulseIn(EchoPin,HIGH); //medimosel tiempoentrepulsos,enmicrosegundos
distanceCm=duration* 10 / 292/ 2; //convertimosadistancia,encm
returndistanceCm;
}

More Related Content

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter

Car wash

  • 1. const intEchoPin1= 2; const intTriggerPin1= 3; const intEchoPin2= 4; const intTriggerPin2= 5; const intEchoPin3= 6; const intTriggerPin3= 7; voidsetup() { Serial.begin(9600); pinMode(TriggerPin1,OUTPUT);//paralas secadorasdisparadordel ultrasonico pinMode(EchoPin1,INPUT);//paralassecadorasecodel ultrasonico pinMode(TriggerPin2,OUTPUT);//paraapagar losmotoresdisparadordel ultrasonico pinMode(EchoPin2,INPUT); //paraapagarlos motoresecodel ultrasonico pinMode(TriggerPin3,OUTPUT);//paraencenderlosmotoresdisparadordel ultrasonico pinMode(EchoPin3,INPUT);//paraencenderlosmotoresECOdel ultrasonico pinMode(8,OUTPUT);//pinde losmotores pinMode(9,OUTPUT);//secadoras digitalWrite(8,LOW);//apagados digitalWrite(9,LOW);//apagados } voidloop() { intcm1 = ping(TriggerPin3,EchoPin3);
  • 2. if (cm1>2 && cm1<15) digitalWrite(8,HIGH); intcm2 = ping(TriggerPin2,EchoPin2); if (cm2>2 && cm2<15) { digitalWrite(8,LOW); } int cm3 = ping(TriggerPin1,EchoPin1); if (cm3>2 && cm3<15) { digitalWrite(8,LOW); digitalWrite(9,HIGH); Serial.print("Distancia:"); Serial.println(cm3); } else { digitalWrite(9,LOW); }
  • 3. } intping(intTriggerPin,intEchoPin) { longduration,distanceCm; digitalWrite(TriggerPin,LOW); //paragenerarunpulsolimpioponemosaLOW 4us delayMicroseconds(4); digitalWrite(TriggerPin,HIGH); //generamosTrigger(disparo) de 10us delayMicroseconds(10); digitalWrite(TriggerPin,LOW); duration= pulseIn(EchoPin,HIGH); //medimosel tiempoentrepulsos,enmicrosegundos distanceCm=duration* 10 / 292/ 2; //convertimosadistancia,encm returndistanceCm; }