[Programming with C++ Project: Burglar alarm system] The goal is to design a burglar alarm system with a variety of features. The basic system has three states, Off, Armed, and Alarm. The user presses...

[Programming with C++ Project: Burglar alarm system] The goal is to design a burglar alarm system with a variety of features. The basic system has three states, Off, Armed, and Alarm. The user presses BTN1 to Arm the system (in which case LED1 shines continuously) and presses BTN1 again to disarm it back to the Off state (when all LED’s are off). Any button press should also be acknowledged by a brief beep on the buzzer. Once Armed, the system will respond to intruders detected by the Reflected Light Sensor (RLS) by switching to the Alarm state, during which time the Buzzer alarm is sounded with a tone. The system should also alert the home owner by sending them an email. The Alarm falls silent (but remains Armed) if the intruder is scared off and departs, or if the system is disarmed back to the Off state by pressing BTN1. Include comments indicating functions of each line of code.


Jan 2021 1 Embedded Systems & IOT: Photon Labs James Peyton Jones. [email protected] Professor, Electrical & Computer Engineering, Villanova, PA 19085. Contents Introduction ................................................................................................................................................................3 1. Getting Started – Lab1a (onboard LED) ..............................................................................................................4 1.1 Simple Digital Output – Lab1b (external LED) ................................................................................................5 1.2 Simple Digital Input – Lab1c (push-button input) ..........................................................................................5 1.3 Simple Digital Input - Lab1d (reflective light sensor) .....................................................................................6 2. ‘Analog’ Input / Output ......................................................................................................................................7 2.1 ADC Input and PWM Output – Lab2a (pot-controlled LED & Motor) ............................................................7 2.2 PWM, Servo, and Tone Outputs – Lab2b (pot-controlled LED, Servo, Tone) .................................................8 2.3 PWM, Servo, and Tone Signals – Lab2c (oscilloscope waveform analysis) ....................................................9 3. Robot Control Project ...................................................................................................................................... 10 3.1 Part1: A function to ‘drive’ the robot motors fwd/back at specified speed .............................................. 10 3.2 Part2: Calling your ‘drive’ function for Line-following robot control .......................................................... 11 4. Dealing with Events & Interrupts .................................................................................................................... 12 4.1 A first attempt: The need for interrupts – Lab4a (toggling flashing on/off) .............................................. 12 4.2 Using a hardware interrupt – Lab4b (easier toggling of flashing on/off) .................................................... 12 4.3 Using timer interrupts – Lab4c (dimmable flashing of LED1) ...................................................................... 13 5. Communicating with the cloud ....................................................................................................................... 14 Only use Chrome as your browser in this lab! Obscure problems can occur with other browsers. ...................... 14 5.1 Reading Photon variables from the cloud – Lab5a (uses http GET) ............................................................ 14 5.2 Calling Photon functions from the cloud – Lab5b (uses PUT) ..................................................................... 15 5.3 Publishing Photon Events to the cloud – Lab5c (using publish) .......................................................
May 01, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here