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.
Dependencies: 4DGL-uLCD-SE SDFileSystem mbed-rtos mbed wave_player
Revision 2:d832b6c139d4, committed 2016-10-13
- Comitter:
- aismail1997
- Date:
- Thu Oct 13 15:28:12 2016 +0000
- Parent:
- 1:3af15e979565
- Commit message:
- update
Changed in this revision
| Part2.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 3af15e979565 -r d832b6c139d4 Part2.cpp
--- a/Part2.cpp Thu Oct 13 13:22:29 2016 +0000
+++ b/Part2.cpp Thu Oct 13 15:28:12 2016 +0000
@@ -36,7 +36,7 @@
// global variables
int light = 0; // to keep track of lighting
-int sound = 0; // to keep track of sound
+int sound = 1; // to keep track of sound
int sb_freq = 0.5; // rgb frequency
int bright = 1; // time of the day
@@ -154,15 +154,18 @@
while(true) { // thread loop
lcd_mutex.lock();
// lcd_sem.wait();
- if (light == 0 && sound == 1) {
+ //if (light == 0 && sound == 1) {
+ if (light == 0) {
// display red siren
uLCD.filled_circle(SIZE_X/2, SIZE_Y/2, 10, RED);
uLCD.filled_rectangle(SIZE_X/2 - 10, SIZE_Y/2, SIZE_X/2 + 10, SIZE_Y/2 + 30, RED);
- } else if (light == 1 || sound == 0) {
+ //} else if (light == 1 || sound == 0) {
+ } else if (light == 1) {
// display white siren
uLCD.filled_circle(SIZE_X/2, SIZE_Y/2, 10, WHITE);
uLCD.filled_rectangle(SIZE_X/2 - 10, SIZE_Y/2, SIZE_X/2 + 10, SIZE_Y/2 + 30, WHITE);
- } else if (light == 2 && sound == 1) {
+ //} else if (light == 2 && sound == 1) {
+ } else if (light == 2) {
// display blue siren
uLCD.filled_circle(SIZE_X/2, SIZE_Y/2, 10, BLUE);
uLCD.filled_rectangle(SIZE_X/2 - 10, SIZE_Y/2, SIZE_X/2 + 10, SIZE_Y/2 + 30, BLUE);