sensor, led, lcd, bluetooth and buzzer

Dependencies:   mbed beep TextLCD

Files at this revision

API Documentation at this revision

Comitter:
afqbot
Date:
Tue Jul 06 19:54:05 2021 +0000
Commit message:
project

Changed in this revision

TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
beep.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 899b65e1a7da TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Tue Jul 06 19:54:05 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/simon/code/TextLCD/#308d188a2d3a
diff -r 000000000000 -r 899b65e1a7da beep.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/beep.lib	Tue Jul 06 19:54:05 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/dreschpe/code/beep/#d8e14429a95f
diff -r 000000000000 -r 899b65e1a7da main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Jul 06 19:54:05 2021 +0000
@@ -0,0 +1,53 @@
+#include "mbed.h"
+#include "TextLCD.h"
+#include "beep.h"
+
+DigitalIn Sensor1(PC_1); //sensor 1
+DigitalIn Sensor2(PC_2); //sensor 2
+DigitalIn Sensor3(PC_3); //sensor 3
+PortOut LED(PortB, 0x03); //LED
+TextLCD lcd(PB_4, PB_5, PB_6, PB_8, PB_9, PB_10); //LCD
+Beep buzzer(PB_2); //buzzer
+Serial bluetooth(PA_9, PA_10); //bluetooth
+
+    float value;
+
+int main()
+{
+    bluetooth.baud(9600);
+    
+    while(1){
+        Sensor1 == 0; //sensor 1 OFF
+        Sensor2 == 0; //sensor 2 OFF
+        Sensor3 == 0; //sensor 3 OFF
+        LED == 0x01; //LED green ON
+        lcd.cls();
+        lcd.printf("ALL OKAY");
+        bluetooth.readable();
+        
+        
+        if (Sensor1 == 1){ //sensor1 ON
+            LED == 0x02; //LED red On
+            lcd.cls();
+            lcd.printf("INTRUDER ALERT");
+            buzzer.beep(1000,1.0);
+            }
+            
+            else if (Sensor2 == 1){ //sensor2 ON
+                LED == 0x02; //LED red ON
+                lcd.cls();
+                lcd.printf("IMTRUDER ALERT");
+                buzzer.beep(1000,1.0);
+                }
+                
+                else if (Sensor3 == 1){ //sensor3 ON
+                    LED == 0x02; //LED red ON
+                    lcd.cls();
+                    lcd.printf("INTRUDER ALERT");
+                    buzzer.beep(1000,1.0);
+                    }
+                }
+            }
+    
+    
+    
diff -r 000000000000 -r 899b65e1a7da mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Jul 06 19:54:05 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file