LPC1768 IR breakbeam sensor

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
faif
Date:
Sun Nov 13 11:33:08 2016 +0000
Parent:
0:ca4cef100279
Commit message:
Fix coding style

Changed in this revision

infrared.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r ca4cef100279 -r 88b1d9bcf3a3 infrared.cpp
--- a/infrared.cpp	Sat Oct 29 19:41:40 2016 +0000
+++ b/infrared.cpp	Sun Nov 13 11:33:08 2016 +0000
@@ -11,13 +11,16 @@
     pc.printf(home);
     pc.printf(cls);
     
-    while (true) {
-        if (!infrared) {
+    while (true) 
+    {
+        if (!infrared) 
+        {
             set_led(my_led, ON, DEBOUNCING_DELAY);
             std::string alert("Intrusion dectected: " + current_date_time());
             show_alert(alert, TEXT_DELAY);
         }
-        else {
+        else 
+        {
             set_led(my_led, OFF, DEBOUNCING_DELAY);
         }
     }
@@ -29,13 +32,15 @@
     wait(delay);
 }
 
-const std::string current_date_time() {
+const std::string current_date_time() 
+{
     time_t rawtime;
     time(&rawtime);
     return ctime(&rawtime);
 }
 
-void show_alert(const std::string& alert, const float delay) {
+void show_alert(const std::string& alert, const float delay) 
+{
     pc.printf(home);
     pc.printf(alert.c_str());
     pc.printf("\r");