Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 3:937505b99ca7
- Parent:
- 2:c65e1c89824c
- Child:
- 4:811ddbbdc15d
--- a/main.cpp Wed Mar 01 16:52:25 2017 +0000
+++ b/main.cpp Wed Mar 01 21:12:13 2017 +0000
@@ -1,9 +1,10 @@
#include "mbed.h"
+//#include "Buzzer.h"
+
DigitalOut myBuzzer(D6);
-
DigitalOut myLedGreen(LED1);
-
+DigitalOut myLedRed(D9);
DigitalIn myButton(PC_13);
DigitalIn myPulse(D7);
@@ -11,7 +12,7 @@
float getpulse(void);
void Sound_AlarmBuzzer(void);
-
+void RedLed_flash (void);
int main()
{
myBuzzer=0;
@@ -36,7 +37,7 @@
while(myButton == 1) {
Sound_AlarmBuzzer();
-
+ RedLed_flash();
}
deepsleep();
}
@@ -45,7 +46,7 @@
while(myButton == 1) {
Sound_AlarmBuzzer();
-
+ RedLed_flash();
}
deepsleep();
@@ -56,6 +57,7 @@
while(myButton == 1) {
Sound_AlarmBuzzer();
+ RedLed_flash();
}
deepsleep();
@@ -111,8 +113,18 @@
void Sound_AlarmBuzzer(void)
{
- myBuzzer=1;
- wait_ms(500);
- myBuzzer=0;
- wait_ms(500);
-}
\ No newline at end of file
+
+ myBuzzer=1;
+ wait_ms(500);
+ myBuzzer=0;
+ wait_ms(500);
+}
+
+void RedLed_flash (void){
+
+ myLedRed=1;
+ wait_ms(50);
+ myLedRed=0;
+ wait_ms(50);
+
+ }
\ No newline at end of file