For this lab, you are to construct a mock burglar alarm. The system will have three...

90.2K

Verified Solution

Question

Programming

For this lab, you are to construct a mock burglar alarm. Thesystem will have three states, armed, disarmed, and alarm, twoinputs in the form of push buttons, and two outputs in the form ofLEDs.

The system should start in the disarmed state with a green LEDlit. Pressing button 1 moves us to the armed state, pressing button2 (our stand-in for a door contact sensor) does nothing.

In the armed state, the red LED should blink off and on.Pressing button 1 disarms the system and returns to that state.Pressing button 2 transitions the system to the alarm state

In the alarm state, the red LED is solid (not blinking).Pressing button 2 does nothing while pressing button 1 disarms thealarm.

Can someone please create a writing schematic and codein Arduino?

Answer & Explanation Solved by verified expert
4.4 Ratings (710 Votes)
Here I am writing the code in Arduino IDE and I am pasting sketch here also I will explain about that line after this alarm sketch int pushbutton17 declration of pin of push button and LED pins int pushbutton28 int greenLED9 int redLED10 int val10val20i0j0 taking some variable which will be use in program to make this system void setup pinModepushbutton1INPUT intializing pinmode of the LEDs and push buttons pinModepushbutton2INPUT pinModegreenLEDOUTPUT pinModeredLEDOUTPUT disarmedstate according to question system    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students