Back to Parent

Processing Steps of Application:

https://particle.hackster.io/team-wireless-marvels-inc/garage-door-status-alert-to-sms-text-bc52f0?ref=channel&ref_id=286_popular___&offset=69  

0 - Process loop starting. Read switches. One time initialization. Read time of day clock.

1 - Start 5 minute timer if any door just opened.

2 - Stop clock if a door closed before a timeout.

3 - Check if a door open too long if not already alerted to an open door

4 - Send alert if necessary and one not already sent. Comments refer to sending a Tweet which is how the Arduino version worked. But the Photon version publishes an event and using IFTTT to monitor events, is much more flexible than just sending a tweet. In fact we don't send a tweet in this version, we just send an SMS. But using IFTTT one can do all sorts of things.

5 - If in alert state and all doors close, send a message to indicate everything is OK again.

6 - If in alert state for 15 minutes, send a reminder that at least one door is still open. Send the status of each door.

7 - Update the time of day every hour to insure our internal clock does not drift from real time.

8 - Update the internal time of day based on how much time has passed since the last time the processing loop executed.

9 - Blink the Blue LED at a rate based on the alert state. The on/off cycle of the LED transcends multiple processing loops. Timers are set to insure the LED blinks at the correct rate.

10 - Check if any door is open or if all doors are closed.

11 - In debug mode print a time stamp every 10 seconds. Also display how many processing loops have been executed and how many milliseconds had passed since the app was started or since the last wrap around of the clock (49+ days).

12 - Delay for 10 milliseconds before returning to step 0.

13 - Show that we are about to return to the Particle firmware for it to do its processing (such as keeping a connection to the Particle cloud alive) before it returns control to the app at step 0.



Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0