SlideShare a Scribd company logo
1 of 2
Arduino Question:
I need an arduino code that does the following:
When a push button switched is released, a timer is started. A hall sensor simulataneously notes
each time a spinning object with a magnet on it passes by and prints out these times. Each time it
does pass by, the time elapsed is recorded. If the object does not pass by for ten seconds,
"DONE" is printed to the window.
Thank You
Solution
#define HALL_SENSOR 2 //macro definition of magnetic and LED pins
#define LED 4
int pirPin = 2;
int counter = 0;
int laststate = HIGH;
void setup()
{
pinsInit();
}
void loop()
{
if(counter <= 10){ //running until for 10 seconds
if(isNearMagnet()){ //checkng near magnet or not
turnOnLED(); //sqithch on indicator
}
counter++;
}
else{
Serial.println("DONE"); //printing DONE to console
}
}

More Related Content

Similar to Arduino Hall Sensor Timer with Magnet Detection and Timeout

Countdown Timer Circuit Diagram with 7 Segment Display
Countdown Timer Circuit Diagram with 7 Segment DisplayCountdown Timer Circuit Diagram with 7 Segment Display
Countdown Timer Circuit Diagram with 7 Segment DisplayImran Risal
 
Arduino Boot Camp Pitch Slides
Arduino Boot Camp Pitch SlidesArduino Boot Camp Pitch Slides
Arduino Boot Camp Pitch SlidesMithi Sevilla
 
Bidirectional Visitor Counter with Automatic ON-OFF Switch2
Bidirectional Visitor Counter with Automatic ON-OFF Switch2Bidirectional Visitor Counter with Automatic ON-OFF Switch2
Bidirectional Visitor Counter with Automatic ON-OFF Switch2DIPAN GHOSH
 
GDGPH Hack Fair Presentation
GDGPH Hack Fair PresentationGDGPH Hack Fair Presentation
GDGPH Hack Fair PresentationMithi Sevilla
 
GreenHouse_v1
GreenHouse_v1GreenHouse_v1
GreenHouse_v1Suraj S
 
Electronz_Chapter_2.pptx
Electronz_Chapter_2.pptxElectronz_Chapter_2.pptx
Electronz_Chapter_2.pptxMokete5
 
Itsp documentation quadcopter flight controller based on kalman filters
Itsp documentation   quadcopter flight controller based on kalman filtersItsp documentation   quadcopter flight controller based on kalman filters
Itsp documentation quadcopter flight controller based on kalman filtersJyotirmaya Mahanta
 
All about ir arduino - cool
All about ir   arduino - coolAll about ir   arduino - cool
All about ir arduino - coolVlada Stoja
 
Project_report_on_Attendance_system
 Project_report_on_Attendance_system Project_report_on_Attendance_system
Project_report_on_Attendance_systemAmi Goswami
 
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdfJayanthi Kannan MK
 
Arduino: Arduino para dummies 2 edición por Wiley Brand parte 2
Arduino: Arduino para dummies 2 edición por Wiley Brand parte 2Arduino: Arduino para dummies 2 edición por Wiley Brand parte 2
Arduino: Arduino para dummies 2 edición por Wiley Brand parte 2SANTIAGO PABLO ALBERTO
 
YOTG Munich - Simon Mang - SixReasons - Hardware prototyping – Sketching with...
YOTG Munich - Simon Mang - SixReasons - Hardware prototyping – Sketching with...YOTG Munich - Simon Mang - SixReasons - Hardware prototyping – Sketching with...
YOTG Munich - Simon Mang - SixReasons - Hardware prototyping – Sketching with...Year of the X
 
IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...
IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...
IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...Jayanthi Kannan MK
 
Basic arduino sketch example
Basic arduino sketch exampleBasic arduino sketch example
Basic arduino sketch examplemraziff2009
 
Mom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics labMom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics labAnnamaria Lisotti
 

Similar to Arduino Hall Sensor Timer with Magnet Detection and Timeout (20)

Countdown Timer Circuit Diagram with 7 Segment Display
Countdown Timer Circuit Diagram with 7 Segment DisplayCountdown Timer Circuit Diagram with 7 Segment Display
Countdown Timer Circuit Diagram with 7 Segment Display
 
Arduino Boot Camp Pitch Slides
Arduino Boot Camp Pitch SlidesArduino Boot Camp Pitch Slides
Arduino Boot Camp Pitch Slides
 
Bidirectional Visitor Counter with Automatic ON-OFF Switch2
Bidirectional Visitor Counter with Automatic ON-OFF Switch2Bidirectional Visitor Counter with Automatic ON-OFF Switch2
Bidirectional Visitor Counter with Automatic ON-OFF Switch2
 
GDGPH Hack Fair Presentation
GDGPH Hack Fair PresentationGDGPH Hack Fair Presentation
GDGPH Hack Fair Presentation
 
GreenHouse_v1
GreenHouse_v1GreenHouse_v1
GreenHouse_v1
 
Electronz_Chapter_2.pptx
Electronz_Chapter_2.pptxElectronz_Chapter_2.pptx
Electronz_Chapter_2.pptx
 
Itsp documentation quadcopter flight controller based on kalman filters
Itsp documentation   quadcopter flight controller based on kalman filtersItsp documentation   quadcopter flight controller based on kalman filters
Itsp documentation quadcopter flight controller based on kalman filters
 
All about ir arduino - cool
All about ir   arduino - coolAll about ir   arduino - cool
All about ir arduino - cool
 
Project_report_on_Attendance_system
 Project_report_on_Attendance_system Project_report_on_Attendance_system
Project_report_on_Attendance_system
 
publish manual
publish manualpublish manual
publish manual
 
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf4 IOT 18ISDE712  MODULE 4 IoT Physical Devices and End Point-Aurdino  Uno.pdf
4 IOT 18ISDE712 MODULE 4 IoT Physical Devices and End Point-Aurdino Uno.pdf
 
Arduino: Arduino para dummies 2 edición por Wiley Brand parte 2
Arduino: Arduino para dummies 2 edición por Wiley Brand parte 2Arduino: Arduino para dummies 2 edición por Wiley Brand parte 2
Arduino: Arduino para dummies 2 edición por Wiley Brand parte 2
 
YOTG Munich - Simon Mang - SixReasons - Hardware prototyping – Sketching with...
YOTG Munich - Simon Mang - SixReasons - Hardware prototyping – Sketching with...YOTG Munich - Simon Mang - SixReasons - Hardware prototyping – Sketching with...
YOTG Munich - Simon Mang - SixReasons - Hardware prototyping – Sketching with...
 
Arduino tutorial A to Z
Arduino tutorial A to ZArduino tutorial A to Z
Arduino tutorial A to Z
 
IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...
IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...
IoT Arduino UNO, RaspberryPi with Python, RaspberryPi Programming using Pytho...
 
Basic arduino sketch example
Basic arduino sketch exampleBasic arduino sketch example
Basic arduino sketch example
 
Arduino: Arduino lcd
Arduino: Arduino lcdArduino: Arduino lcd
Arduino: Arduino lcd
 
Arduino programming
Arduino programmingArduino programming
Arduino programming
 
Mom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics labMom presentation_monday_arduino in the physics lab
Mom presentation_monday_arduino in the physics lab
 
Fun with arduino
Fun with arduinoFun with arduino
Fun with arduino
 

More from vtuan3

Arrange the following elements from greatest to least tendency to acce.docx
Arrange the following elements from greatest to least tendency to acce.docxArrange the following elements from greatest to least tendency to acce.docx
Arrange the following elements from greatest to least tendency to acce.docxvtuan3
 
Arrange the elution sequence of the following compounds by using rever.docx
Arrange the elution sequence of the following compounds by using rever.docxArrange the elution sequence of the following compounds by using rever.docx
Arrange the elution sequence of the following compounds by using rever.docxvtuan3
 
Are you surprised by the variety and range of issues addressed by the.docx
Are you surprised by the variety and range of issues addressed by the.docxAre you surprised by the variety and range of issues addressed by the.docx
Are you surprised by the variety and range of issues addressed by the.docxvtuan3
 
Are there ethical considerations we should consider during the the ent.docx
Are there ethical considerations we should consider during the the ent.docxAre there ethical considerations we should consider during the the ent.docx
Are there ethical considerations we should consider during the the ent.docxvtuan3
 
AP Chemistry Review Questions Integrating Content- Inquiry and Reasoni.docx
AP Chemistry Review Questions Integrating Content- Inquiry and Reasoni.docxAP Chemistry Review Questions Integrating Content- Inquiry and Reasoni.docx
AP Chemistry Review Questions Integrating Content- Inquiry and Reasoni.docxvtuan3
 
answers- 22- H lysine- You do not have to write them all out- ow many.docx
answers- 22- H lysine- You do not have to write them all out- ow many.docxanswers- 22- H lysine- You do not have to write them all out- ow many.docx
answers- 22- H lysine- You do not have to write them all out- ow many.docxvtuan3
 
Answer was D) but I need detailed help with steps as to how - On Janua.docx
Answer was D) but I need detailed help with steps as to how - On Janua.docxAnswer was D) but I need detailed help with steps as to how - On Janua.docx
Answer was D) but I need detailed help with steps as to how - On Janua.docxvtuan3
 
Answer the below in your own words- What were the reasons for the deco.docx
Answer the below in your own words- What were the reasons for the deco.docxAnswer the below in your own words- What were the reasons for the deco.docx
Answer the below in your own words- What were the reasons for the deco.docxvtuan3
 
Answer in your own words- Would you agree with Karl Marx in saying tha.docx
Answer in your own words- Would you agree with Karl Marx in saying tha.docxAnswer in your own words- Would you agree with Karl Marx in saying tha.docx
Answer in your own words- Would you agree with Karl Marx in saying tha.docxvtuan3
 
Analyze the role of credit rationing in both a developed country and a.docx
Analyze the role of credit rationing in both a developed country and a.docxAnalyze the role of credit rationing in both a developed country and a.docx
Analyze the role of credit rationing in both a developed country and a.docxvtuan3
 
Annual worth calculations require equal life alternatives- T or F - An.docx
Annual worth calculations require equal life alternatives- T or F - An.docxAnnual worth calculations require equal life alternatives- T or F - An.docx
Annual worth calculations require equal life alternatives- T or F - An.docxvtuan3
 
Annual editions of journal What will social media look like in the fu.docx
Annual editions of journal  What will social media look like in the fu.docxAnnual editions of journal  What will social media look like in the fu.docx
Annual editions of journal What will social media look like in the fu.docxvtuan3
 
An unknown mixture of ions was treated with hydrochloric acid resultin.docx
An unknown mixture of ions was treated with hydrochloric acid resultin.docxAn unknown mixture of ions was treated with hydrochloric acid resultin.docx
An unknown mixture of ions was treated with hydrochloric acid resultin.docxvtuan3
 
Analyze the role cryptographic algorithms play and explain how these a.docx
Analyze the role cryptographic algorithms play and explain how these a.docxAnalyze the role cryptographic algorithms play and explain how these a.docx
Analyze the role cryptographic algorithms play and explain how these a.docxvtuan3
 
Analyze and determine which sector- public or private- has greater ins.docx
Analyze and determine which sector- public or private- has greater ins.docxAnalyze and determine which sector- public or private- has greater ins.docx
Analyze and determine which sector- public or private- has greater ins.docxvtuan3
 
an102 Tollowing infrared spectra- Some examples of functional groups a.docx
an102 Tollowing infrared spectra- Some examples of functional groups a.docxan102 Tollowing infrared spectra- Some examples of functional groups a.docx
an102 Tollowing infrared spectra- Some examples of functional groups a.docxvtuan3
 
An unknown compound is one of the four compounds shown below- It is an.docx
An unknown compound is one of the four compounds shown below- It is an.docxAn unknown compound is one of the four compounds shown below- It is an.docx
An unknown compound is one of the four compounds shown below- It is an.docxvtuan3
 
Analyze the types of informal and formal communication in organization.docx
Analyze the types of informal and formal communication in organization.docxAnalyze the types of informal and formal communication in organization.docx
Analyze the types of informal and formal communication in organization.docxvtuan3
 
Encapsulation process- Explain this process giving specific detail at.docx
Encapsulation process- Explain this process giving specific detail at.docxEncapsulation process- Explain this process giving specific detail at.docx
Encapsulation process- Explain this process giving specific detail at.docxvtuan3
 
Elijah Murphy studied voice- opera- and Jewish liturgical music at the.docx
Elijah Murphy studied voice- opera- and Jewish liturgical music at the.docxElijah Murphy studied voice- opera- and Jewish liturgical music at the.docx
Elijah Murphy studied voice- opera- and Jewish liturgical music at the.docxvtuan3
 

More from vtuan3 (20)

Arrange the following elements from greatest to least tendency to acce.docx
Arrange the following elements from greatest to least tendency to acce.docxArrange the following elements from greatest to least tendency to acce.docx
Arrange the following elements from greatest to least tendency to acce.docx
 
Arrange the elution sequence of the following compounds by using rever.docx
Arrange the elution sequence of the following compounds by using rever.docxArrange the elution sequence of the following compounds by using rever.docx
Arrange the elution sequence of the following compounds by using rever.docx
 
Are you surprised by the variety and range of issues addressed by the.docx
Are you surprised by the variety and range of issues addressed by the.docxAre you surprised by the variety and range of issues addressed by the.docx
Are you surprised by the variety and range of issues addressed by the.docx
 
Are there ethical considerations we should consider during the the ent.docx
Are there ethical considerations we should consider during the the ent.docxAre there ethical considerations we should consider during the the ent.docx
Are there ethical considerations we should consider during the the ent.docx
 
AP Chemistry Review Questions Integrating Content- Inquiry and Reasoni.docx
AP Chemistry Review Questions Integrating Content- Inquiry and Reasoni.docxAP Chemistry Review Questions Integrating Content- Inquiry and Reasoni.docx
AP Chemistry Review Questions Integrating Content- Inquiry and Reasoni.docx
 
answers- 22- H lysine- You do not have to write them all out- ow many.docx
answers- 22- H lysine- You do not have to write them all out- ow many.docxanswers- 22- H lysine- You do not have to write them all out- ow many.docx
answers- 22- H lysine- You do not have to write them all out- ow many.docx
 
Answer was D) but I need detailed help with steps as to how - On Janua.docx
Answer was D) but I need detailed help with steps as to how - On Janua.docxAnswer was D) but I need detailed help with steps as to how - On Janua.docx
Answer was D) but I need detailed help with steps as to how - On Janua.docx
 
Answer the below in your own words- What were the reasons for the deco.docx
Answer the below in your own words- What were the reasons for the deco.docxAnswer the below in your own words- What were the reasons for the deco.docx
Answer the below in your own words- What were the reasons for the deco.docx
 
Answer in your own words- Would you agree with Karl Marx in saying tha.docx
Answer in your own words- Would you agree with Karl Marx in saying tha.docxAnswer in your own words- Would you agree with Karl Marx in saying tha.docx
Answer in your own words- Would you agree with Karl Marx in saying tha.docx
 
Analyze the role of credit rationing in both a developed country and a.docx
Analyze the role of credit rationing in both a developed country and a.docxAnalyze the role of credit rationing in both a developed country and a.docx
Analyze the role of credit rationing in both a developed country and a.docx
 
Annual worth calculations require equal life alternatives- T or F - An.docx
Annual worth calculations require equal life alternatives- T or F - An.docxAnnual worth calculations require equal life alternatives- T or F - An.docx
Annual worth calculations require equal life alternatives- T or F - An.docx
 
Annual editions of journal What will social media look like in the fu.docx
Annual editions of journal  What will social media look like in the fu.docxAnnual editions of journal  What will social media look like in the fu.docx
Annual editions of journal What will social media look like in the fu.docx
 
An unknown mixture of ions was treated with hydrochloric acid resultin.docx
An unknown mixture of ions was treated with hydrochloric acid resultin.docxAn unknown mixture of ions was treated with hydrochloric acid resultin.docx
An unknown mixture of ions was treated with hydrochloric acid resultin.docx
 
Analyze the role cryptographic algorithms play and explain how these a.docx
Analyze the role cryptographic algorithms play and explain how these a.docxAnalyze the role cryptographic algorithms play and explain how these a.docx
Analyze the role cryptographic algorithms play and explain how these a.docx
 
Analyze and determine which sector- public or private- has greater ins.docx
Analyze and determine which sector- public or private- has greater ins.docxAnalyze and determine which sector- public or private- has greater ins.docx
Analyze and determine which sector- public or private- has greater ins.docx
 
an102 Tollowing infrared spectra- Some examples of functional groups a.docx
an102 Tollowing infrared spectra- Some examples of functional groups a.docxan102 Tollowing infrared spectra- Some examples of functional groups a.docx
an102 Tollowing infrared spectra- Some examples of functional groups a.docx
 
An unknown compound is one of the four compounds shown below- It is an.docx
An unknown compound is one of the four compounds shown below- It is an.docxAn unknown compound is one of the four compounds shown below- It is an.docx
An unknown compound is one of the four compounds shown below- It is an.docx
 
Analyze the types of informal and formal communication in organization.docx
Analyze the types of informal and formal communication in organization.docxAnalyze the types of informal and formal communication in organization.docx
Analyze the types of informal and formal communication in organization.docx
 
Encapsulation process- Explain this process giving specific detail at.docx
Encapsulation process- Explain this process giving specific detail at.docxEncapsulation process- Explain this process giving specific detail at.docx
Encapsulation process- Explain this process giving specific detail at.docx
 
Elijah Murphy studied voice- opera- and Jewish liturgical music at the.docx
Elijah Murphy studied voice- opera- and Jewish liturgical music at the.docxElijah Murphy studied voice- opera- and Jewish liturgical music at the.docx
Elijah Murphy studied voice- opera- and Jewish liturgical music at the.docx
 

Recently uploaded

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxLigayaBacuel1
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 

Recently uploaded (20)

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 

Arduino Hall Sensor Timer with Magnet Detection and Timeout

  • 1. Arduino Question: I need an arduino code that does the following: When a push button switched is released, a timer is started. A hall sensor simulataneously notes each time a spinning object with a magnet on it passes by and prints out these times. Each time it does pass by, the time elapsed is recorded. If the object does not pass by for ten seconds, "DONE" is printed to the window. Thank You Solution #define HALL_SENSOR 2 //macro definition of magnetic and LED pins #define LED 4 int pirPin = 2; int counter = 0; int laststate = HIGH; void setup() { pinsInit(); } void loop() { if(counter <= 10){ //running until for 10 seconds if(isNearMagnet()){ //checkng near magnet or not turnOnLED(); //sqithch on indicator } counter++; } else{ Serial.println("DONE"); //printing DONE to console
  • 2. } }