tdse-tp3_01-lcd_display

Index Commits Files Refs
commit 0f32f35317ac8382b3f7dd803c2d4f79aadbe844
parent 4e28b70ad50d90234dce948b20952d20d3bc9650
Author: Martin Klöckner <mjkloeckner@gmail.com>
Date:   Fri,  3 Oct 2025 21:19:17 +0000

Remove all modules not related to *display*

Diffstat:
Mmain.cpp | 4+---
Dmodules/code/code.cpp | 109-------------------------------------------------------------------------------
Dmodules/code/code.h | 25-------------------------
Dmodules/date_and_time/date_and_time.cpp | 48------------------------------------------------
Dmodules/date_and_time/date_and_time.h | 20--------------------
Dmodules/event_log/event_log.cpp | 117-------------------------------------------------------------------------------
Dmodules/event_log/event_log.h | 31-------------------------------
Dmodules/fire_alarm/fire_alarm.cpp | 149-------------------------------------------------------------------------------
Dmodules/fire_alarm/fire_alarm.h | 22----------------------
Dmodules/gas_sensor/gas_sensor.cpp | 38--------------------------------------
Dmodules/gas_sensor/gas_sensor.h | 18------------------
Dmodules/matrix_keypad/matrix_keypad.cpp | 141-------------------------------------------------------------------------------
Dmodules/matrix_keypad/matrix_keypad.h | 18------------------
Dmodules/pc_serial_com/pc_serial_com.cpp | 311-------------------------------------------------------------------------------
Dmodules/pc_serial_com/pc_serial_com.h | 22----------------------
Dmodules/siren/siren.cpp | 61-------------------------------------------------------------
Dmodules/siren/siren.h | 19-------------------
Dmodules/smart_home_system/smart_home_system.cpp | 45---------------------------------------------
Dmodules/smart_home_system/smart_home_system.h | 20--------------------
Dmodules/strobe_light/strobe_light.cpp | 60------------------------------------------------------------
Dmodules/strobe_light/strobe_light.h | 20--------------------
Dmodules/temperature_sensor/temperature_sensor.cpp | 86-------------------------------------------------------------------------------
Dmodules/temperature_sensor/temperature_sensor.h | 21---------------------
Dmodules/user_interface/user_interface.cpp | 193-------------------------------------------------------------------------------
Dmodules/user_interface/user_interface.h | 26--------------------------
25 files changed, 1 insertion(+), 1623 deletions(-)
diff --git a/main.cpp b/main.cpp
@@ -1,15 +1,13 @@
 //=====[Libraries]=============================================================
 
 #include "mbed.h"
-#include "smart_home_system.h"
 
 //=====[Main function, the program entry point after power on or reset]========
 
 int main()
 {
     printf("Hello, World!\n");
-    smartHomeSystemInit();
     while (true) {
-        smartHomeSystemUpdate();
+        ;
     }
 }
 \ No newline at end of file
diff --git a/modules/code/code.cpp b/modules/code/code.cpp
@@ -1,108 +0,0 @@
-//=====[Libraries]=============================================================
-
-#include "mbed.h"
-#include "arm_book_lib.h"
-
-#include "code.h"
-
-#include "user_interface.h"
-#include "pc_serial_com.h"
-#include "date_and_time.h"
-#include "temperature_sensor.h"
-#include "gas_sensor.h"
-#include "matrix_keypad.h"
-
-//=====[Declaration of private defines]========================================
-
-//=====[Declaration of private data types]=====================================
-
-//=====[Declaration and initialization of public global objects]===============
-
-//=====[Declaration of external public global variables]=======================
-
-extern char codeSequenceFromUserInterface[CODE_NUMBER_OF_KEYS];
-extern char codeSequenceFromPcSerialCom[CODE_NUMBER_OF_KEYS];
-
-//=====[Declaration and initialization of private global variables]============
-
-static int numberOfIncorrectCodes = 0;
-static char codeSequence[CODE_NUMBER_OF_KEYS] = { '1', '8', '0', '5' };
-
-//=====[Declarations (prototypes) of private functions]========================
-
-static bool codeMatch( char* codeToCompare );
-static void codeDeactivate();
-
-//=====[Implementations of public functions]===================================
-
-void codeWrite( char* newCodeSequence )
-{
-    int i;
-    for (i = 0; i < CODE_NUMBER_OF_KEYS; i++) {
-        codeSequence[i] = newCodeSequence[i];
-    }
-}
-
-bool codeMatchFrom( codeOrigin_t codeOrigin )
-{
-    bool codeIsCorrect = false;
-    switch (codeOrigin) {
-        case CODE_KEYPAD:
-            if( userInterfaceCodeCompleteRead() ) {
-                codeIsCorrect = codeMatch(codeSequenceFromUserInterface);
-                userInterfaceCodeCompleteWrite(false);
-                if ( codeIsCorrect ) {
-                    codeDeactivate();
-                } else {
-                    incorrectCodeStateWrite(ON);
-                    numberOfIncorrectCodes++;
-                }
-            }
-
-
-        break;
-        case CODE_PC_SERIAL:
-            if( pcSerialComCodeCompleteRead() ) {
-                codeIsCorrect = codeMatch(codeSequenceFromPcSerialCom);
-                pcSerialComCodeCompleteWrite(false);
-                if ( codeIsCorrect ) {
-                    codeDeactivate();
-                    pcSerialComStringWrite( "\r\nThe code is correct\r\n\r\n" );
-                } else {
-                    incorrectCodeStateWrite(ON);
-                    numberOfIncorrectCodes++;
-                    pcSerialComStringWrite( "\r\nThe code is incorrect\r\n\r\n" );
-                }
-            }
-
-        break;
-        default:
-        break;
-    }
-
-    if ( numberOfIncorrectCodes >= 5 ) {
-        systemBlockedStateWrite(ON);
-    }
-
-    return codeIsCorrect;
-}
-
-//=====[Implementations of private functions]==================================
-
-static bool codeMatch( char* codeToCompare )
-{
-    int i;
-    for (i = 0; i < CODE_NUMBER_OF_KEYS; i++) {
-        if ( codeSequence[i] != codeToCompare[i] ) {
-            return false;
-        }
-    }
-    return true;
-}
-
-static void codeDeactivate()
-{
-    systemBlockedStateWrite(OFF);
-    incorrectCodeStateWrite(OFF);
-    numberOfIncorrectCodes = 0;
-}
-\ No newline at end of file
diff --git a/modules/code/code.h b/modules/code/code.h
@@ -1,24 +0,0 @@
-//=====[#include guards - begin]===============================================
-
-#ifndef _CODE_H_
-#define _CODE_H_
-
-//=====[Declaration of public defines]=========================================
-
-#define CODE_NUMBER_OF_KEYS   4
-
-//=====[Declaration of public data types]======================================
-
-typedef enum{
-    CODE_KEYPAD,
-    CODE_PC_SERIAL,
-} codeOrigin_t;
-
-//=====[Declarations (prototypes) of public functions]=========================
-
-void codeWrite( char* newCodeSequence );
-bool codeMatchFrom( codeOrigin_t codeOrigin );
-
-//=====[#include guards - end]=================================================
-
-#endif // _CODE_H_
-\ No newline at end of file
diff --git a/modules/date_and_time/date_and_time.cpp b/modules/date_and_time/date_and_time.cpp
@@ -1,48 +0,0 @@
-//=====[Libraries]=============================================================
-
-#include "mbed.h"
-
-#include "date_and_time.h"
-
-//=====[Declaration of private defines]========================================
-
-//=====[Declaration of private data types]=====================================
-
-//=====[Declaration and initialization of public global objects]===============
-
-//=====[Declaration of external public global variables]=======================
-
-//=====[Declaration and initialization of public global variables]=============
-
-//=====[Declaration and initialization of private global variables]============
-
-//=====[Declarations (prototypes) of private functions]========================
-
-//=====[Implementations of public functions]===================================
-
-char* dateAndTimeRead()
-{
-    time_t epochSeconds;
-    epochSeconds = time(NULL);
-    return ctime(&epochSeconds);    
-}
-
-void dateAndTimeWrite( int year, int month, int day, 
-                       int hour, int minute, int second )
-{
-    struct tm rtcTime;
-
-    rtcTime.tm_year = year - 1900;
-    rtcTime.tm_mon  = month - 1;
-    rtcTime.tm_mday = day;
-    rtcTime.tm_hour = hour;
-    rtcTime.tm_min  = minute;
-    rtcTime.tm_sec  = second;
-
-    rtcTime.tm_isdst = -1;
-
-    set_time( mktime( &rtcTime ) );
-}
-
-//=====[Implementations of private functions]==================================
-
diff --git a/modules/date_and_time/date_and_time.h b/modules/date_and_time/date_and_time.h
@@ -1,19 +0,0 @@
-//=====[#include guards - begin]===============================================
-
-#ifndef _DATE_AND_TIME_H_
-#define _DATE_AND_TIME_H_
-
-//=====[Declaration of public defines]=========================================
-
-//=====[Declaration of public data types]======================================
-
-//=====[Declarations (prototypes) of public functions]=========================
-
-char* dateAndTimeRead();
-
-void dateAndTimeWrite( int year, int month, int day, 
-                       int hour, int minute, int second );
-
-//=====[#include guards - end]=================================================
-
-#endif // _DATE_AND_TIME_H_
-\ No newline at end of file
diff --git a/modules/event_log/event_log.cpp b/modules/event_log/event_log.cpp
@@ -1,117 +0,0 @@
-//=====[Libraries]=============================================================
-
-#include "mbed.h"
-#include "arm_book_lib.h"
-
-#include "event_log.h"
-
-#include "siren.h"
-#include "fire_alarm.h"
-#include "user_interface.h"
-#include "date_and_time.h"
-#include "pc_serial_com.h"
-
-//=====[Declaration of private defines]========================================
-
-//=====[Declaration of private data types]=====================================
-
-typedef struct systemEvent {
-    time_t seconds;
-    char typeOfEvent[EVENT_LOG_NAME_MAX_LENGTH];
-} systemEvent_t;
-
-//=====[Declaration and initialization of public global objects]===============
-
-//=====[Declaration of external public global variables]=======================
-
-//=====[Declaration and initialization of public global variables]=============
-
-//=====[Declaration and initialization of private global variables]============
-
-static bool sirenLastState = OFF;
-static bool gasLastState   = OFF;
-static bool tempLastState  = OFF;
-static bool ICLastState    = OFF;
-static bool SBLastState    = OFF;
-static int eventsIndex     = 0;
-static systemEvent_t arrayOfStoredEvents[EVENT_LOG_MAX_STORAGE];
-
-//=====[Declarations (prototypes) of private functions]========================
-
-static void eventLogElementStateUpdate( bool lastState,
-                                        bool currentState,
-                                        const char* elementName );
-
-//=====[Implementations of public functions]===================================
-
-void eventLogUpdate()
-{
-    bool currentState = sirenStateRead();
-    eventLogElementStateUpdate( sirenLastState, currentState, "ALARM" );
-    sirenLastState = currentState;
-
-    currentState = gasDetectorStateRead();
-    eventLogElementStateUpdate( gasLastState, currentState, "GAS_DET" );
-    gasLastState = currentState;
-
-    currentState = overTemperatureDetectorStateRead();
-    eventLogElementStateUpdate( tempLastState, currentState, "OVER_TEMP" );
-    tempLastState = currentState;
-
-    currentState = incorrectCodeStateRead();
-    eventLogElementStateUpdate( ICLastState, currentState, "LED_IC" );
-    ICLastState = currentState;
-
-    currentState = systemBlockedStateRead();
-    eventLogElementStateUpdate( SBLastState ,currentState, "LED_SB" );
-    SBLastState = currentState;
-}
-
-int eventLogNumberOfStoredEvents()
-{
-    return eventsIndex;
-}
-
-void eventLogRead( int index, char* str )
-{
-    str[0] = '\0';
-    strcat( str, "Event = " );
-    strcat( str, arrayOfStoredEvents[index].typeOfEvent );
-    strcat( str, "\r\nDate and Time = " );
-    strcat( str, ctime(&arrayOfStoredEvents[index].seconds) );
-    strcat( str, "\r\n" );
-}
-
-void eventLogWrite( bool currentState, const char* elementName )
-{
-    char eventAndStateStr[EVENT_LOG_NAME_MAX_LENGTH] = "";
-
-    strcat( eventAndStateStr, elementName );
-    if ( currentState ) {
-        strcat( eventAndStateStr, "_ON" );
-    } else {
-        strcat( eventAndStateStr, "_OFF" );
-    }
-
-    arrayOfStoredEvents[eventsIndex].seconds = time(NULL);
-    strcpy( arrayOfStoredEvents[eventsIndex].typeOfEvent, eventAndStateStr );
-    if ( eventsIndex < EVENT_LOG_MAX_STORAGE -1 ) {
-        eventsIndex++;
-    } else {
-        eventsIndex = 0;
-    }
-
-    pcSerialComStringWrite(eventAndStateStr);
-    pcSerialComStringWrite("\r\n");
-}
-
-//=====[Implementations of private functions]==================================
-
-static void eventLogElementStateUpdate( bool lastState,
-                                        bool currentState,
-                                        const char* elementName )
-{
-    if ( lastState != currentState ) {        
-        eventLogWrite( currentState, elementName );       
-    }
-}
diff --git a/modules/event_log/event_log.h b/modules/event_log/event_log.h
@@ -1,31 +0,0 @@
-//=====[#include guards - begin]===============================================
-
-#ifndef _EVENT_LOG_H_
-#define _EVENT_LOG_H_
-
-//=====[Declaration of public defines]=========================================
-
-#define EVENT_LOG_MAX_STORAGE        20
-#define EVENT_HEAD_STR_LENGTH         8
-#define EVENT_LOG_NAME_MAX_LENGTH    13
-#define DATE_AND_TIME_STR_LENGTH     18
-#define CTIME_STR_LENGTH             25
-#define NEW_LINE_STR_LENGTH           3
-#define EVENT_STR_LENGTH             (EVENT_HEAD_STR_LENGTH + \
-                                      EVENT_LOG_NAME_MAX_LENGTH + \
-                                      DATE_AND_TIME_STR_LENGTH  + \
-                                      CTIME_STR_LENGTH + \
-                                      NEW_LINE_STR_LENGTH)
-
-//=====[Declaration of public data types]======================================
-
-//=====[Declarations (prototypes) of public functions]=========================
-
-void eventLogUpdate();
-int eventLogNumberOfStoredEvents();
-void eventLogRead( int index, char* str );
-void eventLogWrite( bool currentState, const char* elementName );
-
-//=====[#include guards - end]=================================================
-
-#endif // _EVENT_LOG_H_
diff --git a/modules/fire_alarm/fire_alarm.cpp b/modules/fire_alarm/fire_alarm.cpp
@@ -1,149 +0,0 @@
-//=====[Libraries]=============================================================
-
-#include "mbed.h"
-#include "arm_book_lib.h"
-
-#include "fire_alarm.h"
-
-#include "siren.h"
-#include "strobe_light.h"
-#include "user_interface.h"
-#include "code.h"
-#include "date_and_time.h"
-#include "temperature_sensor.h"
-#include "gas_sensor.h"
-#include "matrix_keypad.h"
-
-//=====[Declaration of private defines]========================================
-
-#define TEMPERATURE_C_LIMIT_ALARM               50.0
-#define STROBE_TIME_GAS               1000
-#define STROBE_TIME_OVER_TEMP          500
-#define STROBE_TIME_GAS_AND_OVER_TEMP  100
-
-//=====[Declaration of private data types]=====================================
-
-//=====[Declaration and initialization of public global objects]===============
-
-DigitalIn alarmTestButton(BUTTON1);
-
-//=====[Declaration of external public global variables]=======================
-
-//=====[Declaration and initialization of public global variables]=============
-
-//=====[Declaration and initialization of private global variables]============
-
-static bool gasDetected                  = OFF;
-static bool overTemperatureDetected      = OFF;
-static bool gasDetectorState             = OFF;
-static bool overTemperatureDetectorState = OFF;
-
-//=====[Declarations (prototypes) of private functions]========================
-
-static void fireAlarmActivationUpdate();
-static void fireAlarmDeactivationUpdate();
-static void fireAlarmDeactivate();
-static int fireAlarmStrobeTime();
-
-//=====[Implementations of public functions]===================================
-
-void fireAlarmInit()
-{
-    temperatureSensorInit();
-    gasSensorInit();
-    sirenInit();
-    strobeLightInit();    
-    
-    alarmTestButton.mode(PullDown); 
-}
-
-void fireAlarmUpdate()
-{
-    fireAlarmActivationUpdate();
-    fireAlarmDeactivationUpdate();
-    sirenUpdate( fireAlarmStrobeTime() );
-    strobeLightUpdate( fireAlarmStrobeTime() );    
-}
-
-bool gasDetectorStateRead()
-{
-    return gasDetectorState;
-}
-
-bool overTemperatureDetectorStateRead()
-{
-    return overTemperatureDetectorState;
-}
-
-bool gasDetectedRead()
-{
-    return gasDetected;
-}
-
-bool overTemperatureDetectedRead()
-{
-    return overTemperatureDetected;
-}
-
-//=====[Implementations of private functions]==================================
-
-static void fireAlarmActivationUpdate()
-{
-    temperatureSensorUpdate();
-    gasSensorUpdate();
-
-    overTemperatureDetectorState = temperatureSensorReadCelsius() > 
-                                   TEMPERATURE_C_LIMIT_ALARM;
-
-    if ( overTemperatureDetectorState ) {
-        overTemperatureDetected = ON;
-        sirenStateWrite(ON);
-        strobeLightStateWrite(ON);
-    }
-
-    gasDetectorState = !gasSensorRead();
-
-    if ( gasDetectorState ) {
-        gasDetected = ON;
-        sirenStateWrite(ON);
-        strobeLightStateWrite(ON);
-    }
-    
-    if( alarmTestButton ) {             
-        overTemperatureDetected = ON;
-        gasDetected = ON;
-        sirenStateWrite(ON);
-        strobeLightStateWrite(ON);
-    }
-}
-
-static void fireAlarmDeactivationUpdate()
-{
-    if ( sirenStateRead() ) {
-        if ( codeMatchFrom(CODE_KEYPAD) ||
-             codeMatchFrom(CODE_PC_SERIAL) ) {
-            fireAlarmDeactivate();
-        }
-    }
-}
-
-static void fireAlarmDeactivate()
-{
-    sirenStateWrite(OFF);
-    strobeLightStateWrite(OFF);
-    overTemperatureDetected = OFF;
-    gasDetected             = OFF;    
-}
-
-static int fireAlarmStrobeTime()
-{
-    if( gasDetectedRead() && overTemperatureDetectedRead() ) {
-        return STROBE_TIME_GAS_AND_OVER_TEMP;
-    } else if ( gasDetectedRead() ) {
-        return STROBE_TIME_GAS;
-    } else if ( overTemperatureDetectedRead() ) {
-        return STROBE_TIME_OVER_TEMP;
-    } else {
-        return 0;
-    }
-}
diff --git a/modules/fire_alarm/fire_alarm.h b/modules/fire_alarm/fire_alarm.h
@@ -1,21 +0,0 @@
-//=====[#include guards - begin]===============================================
-
-#ifndef _FIRE_ALARM_H_
-#define _FIRE_ALARM_H_
-
-//=====[Declaration of public defines]=========================================
-
-//=====[Declaration of public data types]======================================
-
-//=====[Declarations (prototypes) of public functions]=========================
-
-void fireAlarmInit();
-void fireAlarmUpdate();
-bool gasDetectorStateRead();
-bool overTemperatureDetectorStateRead();
-bool gasDetectedRead();
-bool overTemperatureDetectedRead();
-
-//=====[#include guards - end]=================================================
-
-#endif // _FIRE_ALARM_H_
-\ No newline at end of file
diff --git a/modules/gas_sensor/gas_sensor.cpp b/modules/gas_sensor/gas_sensor.cpp
@@ -1,38 +0,0 @@
-//=====[Libraries]=============================================================
-
-#include "mbed.h"
-
-#include "gas_sensor.h"
-
-//=====[Declaration of private defines]========================================
-
-//=====[Declaration of private data types]=====================================
-
-//=====[Declaration and initialization of public global objects]===============
-
-DigitalIn mq2(PE_12);
-
-//=====[Declaration of external public global variables]=======================
-
-//=====[Declaration and initialization of public global variables]=============
-
-//=====[Declaration and initialization of private global variables]============
-
-//=====[Declarations (prototypes) of private functions]========================
-
-//=====[Implementations of public functions]===================================
-
-void gasSensorInit()
-{
-}
-
-void gasSensorUpdate()
-{
-}
-
-bool gasSensorRead()
-{
-    return mq2;
-}
-
-//=====[Implementations of private functions]==================================
diff --git a/modules/gas_sensor/gas_sensor.h b/modules/gas_sensor/gas_sensor.h
@@ -1,18 +0,0 @@
-//=====[#include guards - begin]===============================================
-
-#ifndef _GAS_SENSOR_H_
-#define _GAS_SENSOR_H_
-
-//=====[Declaration of public defines]=========================================
-
-//=====[Declaration of public data types]======================================
-
-//=====[Declarations (prototypes) of public functions]=========================
-
-void gasSensorInit();
-void gasSensorUpdate();
-bool gasSensorRead();
-
-//=====[#include guards - end]=================================================
-
-#endif // _GAS_SENSOR_H_
diff --git a/modules/matrix_keypad/matrix_keypad.cpp b/modules/matrix_keypad/matrix_keypad.cpp
@@ -1,141 +0,0 @@
-//=====[Libraries]=============================================================
-
-#include "mbed.h"
-#include "arm_book_lib.h"
-
-#include "matrix_keypad.h"
-
-#include "date_and_time.h"
-
-//=====[Declaration of private defines]========================================
-
-#define MATRIX_KEYPAD_NUMBER_OF_ROWS    4
-#define MATRIX_KEYPAD_NUMBER_OF_COLS    4
-#define DEBOUNCE_KEY_TIME_MS        40
-
-//=====[Declaration of private data types]=====================================
-
-typedef enum {
-    MATRIX_KEYPAD_SCANNING,
-    MATRIX_KEYPAD_DEBOUNCE,
-    MATRIX_KEYPAD_KEY_HOLD_PRESSED
-} matrixKeypadState_t;
-
-//=====[Declaration and initialization of public global objects]===============
-
-DigitalOut keypadRowPins[MATRIX_KEYPAD_NUMBER_OF_ROWS] = {PB_3, PB_5, PC_7, PA_15};
-DigitalIn keypadColPins[MATRIX_KEYPAD_NUMBER_OF_COLS]  = {PB_12, PB_13, PB_15, PC_6};
-
-//=====[Declaration of external public global variables]=======================
-
-//=====[Declaration and initialization of public global variables]=============
-
-//=====[Declaration and initialization of private global variables]============
-
-static matrixKeypadState_t matrixKeypadState;
-static int timeIncrement_ms = 0;
-
-//=====[Declarations (prototypes) of private functions]========================
-
-static char matrixKeypadScan();
-static void matrixKeypadReset();
-
-//=====[Implementations of public functions]===================================
-
-void matrixKeypadInit( int updateTime_ms )
-{
-    timeIncrement_ms = updateTime_ms;
-    matrixKeypadState = MATRIX_KEYPAD_SCANNING;
-    int pinIndex = 0;
-    for( pinIndex=0; pinIndex<MATRIX_KEYPAD_NUMBER_OF_COLS; pinIndex++ ) {
-        (keypadColPins[pinIndex]).mode(PullUp);
-    }
-}
-
-char matrixKeypadUpdate()
-{
-    static int accumulatedDebounceMatrixKeypadTime = 0;
-    static char matrixKeypadLastKeyPressed = '\0';
-
-    char keyDetected = '\0';
-    char keyReleased = '\0';
-
-    switch( matrixKeypadState ) {
-
-    case MATRIX_KEYPAD_SCANNING:
-        keyDetected = matrixKeypadScan();
-        if( keyDetected != '\0' ) {
-            matrixKeypadLastKeyPressed = keyDetected;
-            accumulatedDebounceMatrixKeypadTime = 0;
-            matrixKeypadState = MATRIX_KEYPAD_DEBOUNCE;
-        }
-        break;
-
-    case MATRIX_KEYPAD_DEBOUNCE:
-        if( accumulatedDebounceMatrixKeypadTime >=
-            DEBOUNCE_KEY_TIME_MS ) {
-            keyDetected = matrixKeypadScan();
-            if( keyDetected == matrixKeypadLastKeyPressed ) {
-                matrixKeypadState = MATRIX_KEYPAD_KEY_HOLD_PRESSED;
-            } else {
-                matrixKeypadState = MATRIX_KEYPAD_SCANNING;
-            }
-        }
-        accumulatedDebounceMatrixKeypadTime =
-            accumulatedDebounceMatrixKeypadTime + timeIncrement_ms;
-        break;
-
-    case MATRIX_KEYPAD_KEY_HOLD_PRESSED:
-        keyDetected = matrixKeypadScan();
-        if( keyDetected != matrixKeypadLastKeyPressed ) {
-            if( keyDetected == '\0' ) {
-                keyReleased = matrixKeypadLastKeyPressed;
-            }
-            matrixKeypadState = MATRIX_KEYPAD_SCANNING;
-        }
-        break;
-
-    default:
-        matrixKeypadReset();
-        break;
-    }
-    return keyReleased;
-}
-
-//=====[Implementations of private functions]==================================
-
-static char matrixKeypadScan()
-{
-    int row = 0;
-    int col = 0;
-    int i = 0; 
-
-    char matrixKeypadIndexToCharArray[] = {
-        '1', '2', '3', 'A',
-        '4', '5', '6', 'B',
-        '7', '8', '9', 'C',
-        '*', '0', '#', 'D',
-    };
-
-    for( row=0; row<MATRIX_KEYPAD_NUMBER_OF_ROWS; row++ ) {
-
-        for( i=0; i<MATRIX_KEYPAD_NUMBER_OF_ROWS; i++ ) {
-            keypadRowPins[i] = ON;
-        }
-
-        keypadRowPins[row] = OFF;
-
-        for( col=0; col<MATRIX_KEYPAD_NUMBER_OF_COLS; col++ ) {
-            if( keypadColPins[col] == OFF ) {
-                return matrixKeypadIndexToCharArray[
-                    row*MATRIX_KEYPAD_NUMBER_OF_ROWS + col];
-            }
-        }
-    }
-    return '\0';
-}
-
-static void matrixKeypadReset()
-{
-    matrixKeypadState = MATRIX_KEYPAD_SCANNING;
-}
diff --git a/modules/matrix_keypad/matrix_keypad.h b/modules/matrix_keypad/matrix_keypad.h
@@ -1,17 +0,0 @@
-//=====[#include guards - begin]===============================================
-
-#ifndef _MATRIX_KEYPAD_H_
-#define _MATRIX_KEYPAD_H_
-
-//=====[Declaration of public defines]=========================================
-
-//=====[Declaration of public data types]======================================
-
-//=====[Declarations (prototypes) of public functions]=========================
-
-void matrixKeypadInit( int updateTime_ms );
-char matrixKeypadUpdate();
-
-//=====[#include guards - end]=================================================
-
-#endif // _MATRIX_KEYPAD_H_
-\ No newline at end of file
diff --git a/modules/pc_serial_com/pc_serial_com.cpp b/modules/pc_serial_com/pc_serial_com.cpp
@@ -1,310 +0,0 @@
-//=====[Libraries]=============================================================
-
-#include "mbed.h"
-#include "arm_book_lib.h"
-
-#include "pc_serial_com.h"
-
-#include "siren.h"
-#include "fire_alarm.h"
-#include "code.h"
-#include "date_and_time.h"
-#include "temperature_sensor.h"
-#include "gas_sensor.h"
-#include "event_log.h"
-
-//=====[Declaration of private defines]========================================
-
-//=====[Declaration of private data types]=====================================
-
-typedef enum{
-    PC_SERIAL_COMMANDS,
-    PC_SERIAL_GET_CODE,
-    PC_SERIAL_SAVE_NEW_CODE,
-} pcSerialComMode_t;
-
-//=====[Declaration and initialization of public global objects]===============
-
-UnbufferedSerial uartUsb(USBTX, USBRX, 115200);
-
-//=====[Declaration of external public global variables]=======================
-
-//=====[Declaration and initialization of public global variables]=============
-
-char codeSequenceFromPcSerialCom[CODE_NUMBER_OF_KEYS];
-
-//=====[Declaration and initialization of private global variables]============
-
-static pcSerialComMode_t pcSerialComMode = PC_SERIAL_COMMANDS;
-static bool codeComplete = false;
-static int numberOfCodeChars = 0;
-
-//=====[Declarations (prototypes) of private functions]========================
-
-static void pcSerialComStringRead( char* str, int strLength );
-
-static void pcSerialComGetCodeUpdate( char receivedChar );
-static void pcSerialComSaveNewCodeUpdate( char receivedChar );
-
-static void pcSerialComCommandUpdate( char receivedChar );
-
-static void availableCommands();
-static void commandShowCurrentAlarmState();
-static void commandShowCurrentGasDetectorState();
-static void commandShowCurrentOverTemperatureDetectorState();
-static void commandEnterCodeSequence();
-static void commandEnterNewCode();
-static void commandShowCurrentTemperatureInCelsius();
-static void commandShowCurrentTemperatureInFahrenheit();
-static void commandSetDateAndTime();
-static void commandShowDateAndTime();
-static void commandShowStoredEvents();
-
-//=====[Implementations of public functions]===================================
-
-void pcSerialComInit()
-{
-    availableCommands();
-}
-
-char pcSerialComCharRead()
-{
-    char receivedChar = '\0';
-    if( uartUsb.readable() ) {
-        uartUsb.read( &receivedChar, 1 );
-    }
-    return receivedChar;
-}
-
-void pcSerialComStringWrite( const char* str )
-{
-    uartUsb.write( str, strlen(str) );
-}
-
-void pcSerialComUpdate()
-{
-    char receivedChar = pcSerialComCharRead();
-    if( receivedChar != '\0' ) {
-        switch ( pcSerialComMode ) {
-            case PC_SERIAL_COMMANDS:
-                pcSerialComCommandUpdate( receivedChar );
-            break;
-
-            case PC_SERIAL_GET_CODE:
-                pcSerialComGetCodeUpdate( receivedChar );
-            break;
-
-            case PC_SERIAL_SAVE_NEW_CODE:
-                pcSerialComSaveNewCodeUpdate( receivedChar );
-            break;
-            default:
-                pcSerialComMode = PC_SERIAL_COMMANDS;
-            break;
-        }
-    }    
-}
-
-bool pcSerialComCodeCompleteRead()
-{
-    return codeComplete;
-}
-
-void pcSerialComCodeCompleteWrite( bool state )
-{
-    codeComplete = state;
-}
-
-//=====[Implementations of private functions]==================================
-
-static void pcSerialComStringRead( char* str, int strLength )
-{
-    int strIndex;
-    for ( strIndex = 0; strIndex < strLength; strIndex++) {
-        uartUsb.read( &str[strIndex] , 1 );
-        uartUsb.write( &str[strIndex] ,1 );
-    }
-    str[strLength]='\0';
-}
-
-static void pcSerialComGetCodeUpdate( char receivedChar )
-{
-    codeSequenceFromPcSerialCom[numberOfCodeChars] = receivedChar;
-    pcSerialComStringWrite( "*" );
-    numberOfCodeChars++;
-   if ( numberOfCodeChars >= CODE_NUMBER_OF_KEYS ) {
-        pcSerialComMode = PC_SERIAL_COMMANDS;
-        codeComplete = true;
-        numberOfCodeChars = 0;
-    } 
-}
-
-static void pcSerialComSaveNewCodeUpdate( char receivedChar )
-{
-    static char newCodeSequence[CODE_NUMBER_OF_KEYS];
-
-    newCodeSequence[numberOfCodeChars] = receivedChar;
-    pcSerialComStringWrite( "*" );
-    numberOfCodeChars++;
-    if ( numberOfCodeChars >= CODE_NUMBER_OF_KEYS ) {
-        pcSerialComMode = PC_SERIAL_COMMANDS;
-        numberOfCodeChars = 0;
-        codeWrite( newCodeSequence );
-        pcSerialComStringWrite( "\r\nNew code configured\r\n\r\n" );
-    } 
-}
-
-static void pcSerialComCommandUpdate( char receivedChar )
-{
-    switch (receivedChar) {
-        case '1': commandShowCurrentAlarmState(); break;
-        case '2': commandShowCurrentGasDetectorState(); break;
-        case '3': commandShowCurrentOverTemperatureDetectorState(); break;
-        case '4': commandEnterCodeSequence(); break;
-        case '5': commandEnterNewCode(); break;
-        case 'c': case 'C': commandShowCurrentTemperatureInCelsius(); break;
-        case 'f': case 'F': commandShowCurrentTemperatureInFahrenheit(); break;
-        case 's': case 'S': commandSetDateAndTime(); break;
-        case 't': case 'T': commandShowDateAndTime(); break;
-        case 'e': case 'E': commandShowStoredEvents(); break;
-        default: availableCommands(); break;
-    } 
-}
-
-static void availableCommands()
-{
-    pcSerialComStringWrite( "Available commands:\r\n" );
-    pcSerialComStringWrite( "Press '1' to get the alarm state\r\n" );
-    pcSerialComStringWrite( "Press '2' to get the gas detector state\r\n" );
-    pcSerialComStringWrite( "Press '3' to get the over temperature detector state\r\n" );
-    pcSerialComStringWrite( "Press '4' to enter the code to deactivate the alarm\r\n" );
-    pcSerialComStringWrite( "Press '5' to enter a new code to deactivate the alarm\r\n" );
-    pcSerialComStringWrite( "Press 'f' or 'F' to get lm35 reading in Fahrenheit\r\n" );
-    pcSerialComStringWrite( "Press 'c' or 'C' to get lm35 reading in Celsius\r\n" );
-    pcSerialComStringWrite( "Press 's' or 'S' to set the date and time\r\n" );
-    pcSerialComStringWrite( "Press 't' or 'T' to get the date and time\r\n" );
-    pcSerialComStringWrite( "Press 'e' or 'E' to get the stored events\r\n" );
-    pcSerialComStringWrite( "\r\n" );
-}
-
-static void commandShowCurrentAlarmState()
-{
-    if ( sirenStateRead() ) {
-        pcSerialComStringWrite( "The alarm is activated\r\n");
-    } else {
-        pcSerialComStringWrite( "The alarm is not activated\r\n");
-    }
-}
-
-static void commandShowCurrentGasDetectorState()
-{
-    if ( gasDetectorStateRead() ) {
-        pcSerialComStringWrite( "Gas is being detected\r\n");
-    } else {
-        pcSerialComStringWrite( "Gas is not being detected\r\n");
-    }    
-}
-
-static void commandShowCurrentOverTemperatureDetectorState()
-{
-    if ( overTemperatureDetectorStateRead() ) {
-        pcSerialComStringWrite( "Temperature is above the maximum level\r\n");
-    } else {
-        pcSerialComStringWrite( "Temperature is below the maximum level\r\n");
-    }
-}
-
-static void commandEnterCodeSequence()
-{
-    if( sirenStateRead() ) {
-        pcSerialComStringWrite( "Please enter the four digits numeric code " );
-        pcSerialComStringWrite( "to deactivate the alarm: " );
-        pcSerialComMode = PC_SERIAL_GET_CODE;
-        codeComplete = false;
-        numberOfCodeChars = 0;
-    } else {
-        pcSerialComStringWrite( "Alarm is not activated.\r\n" );
-    }
-}
-
-static void commandEnterNewCode()
-{
-    pcSerialComStringWrite( "Please enter the new four digits numeric code " );
-    pcSerialComStringWrite( "to deactivate the alarm: " );
-    numberOfCodeChars = 0;
-    pcSerialComMode = PC_SERIAL_SAVE_NEW_CODE;
-
-}
-
-static void commandShowCurrentTemperatureInCelsius()
-{
-    char str[100] = "";
-    sprintf ( str, "Temperature: %.2f \xB0 C\r\n",
-                    temperatureSensorReadCelsius() );
-    pcSerialComStringWrite( str );  
-}
-
-static void commandShowCurrentTemperatureInFahrenheit()
-{
-    char str[100] = "";
-    sprintf ( str, "Temperature: %.2f \xB0 C\r\n",
-                    temperatureSensorReadFahrenheit() );
-    pcSerialComStringWrite( str );  
-}
-
-static void commandSetDateAndTime()
-{
-    char year[5] = "";
-    char month[3] = "";
-    char day[3] = "";
-    char hour[3] = "";
-    char minute[3] = "";
-    char second[3] = "";
-    
-    pcSerialComStringWrite("\r\nType four digits for the current year (YYYY): ");
-    pcSerialComStringRead( year, 4);
-    pcSerialComStringWrite("\r\n");
-
-    pcSerialComStringWrite("Type two digits for the current month (01-12): ");
-    pcSerialComStringRead( month, 2);
-    pcSerialComStringWrite("\r\n");
-
-    pcSerialComStringWrite("Type two digits for the current day (01-31): ");
-    pcSerialComStringRead( day, 2);
-    pcSerialComStringWrite("\r\n");
-
-    pcSerialComStringWrite("Type two digits for the current hour (00-23): ");
-    pcSerialComStringRead( hour, 2);
-    pcSerialComStringWrite("\r\n");
-
-    pcSerialComStringWrite("Type two digits for the current minutes (00-59): ");
-    pcSerialComStringRead( minute, 2);
-    pcSerialComStringWrite("\r\n");
-
-    pcSerialComStringWrite("Type two digits for the current seconds (00-59): ");
-    pcSerialComStringRead( second, 2);
-    pcSerialComStringWrite("\r\n");
-    
-    pcSerialComStringWrite("Date and time has been set\r\n");
-
-    dateAndTimeWrite( atoi(year), atoi(month), atoi(day), 
-        atoi(hour), atoi(minute), atoi(second) );
-}
-
-static void commandShowDateAndTime()
-{
-    char str[100] = "";
-    sprintf ( str, "Date and Time = %s", dateAndTimeRead() );
-    pcSerialComStringWrite( str );
-    pcSerialComStringWrite("\r\n");
-}
-
-static void commandShowStoredEvents()
-{
-    char str[EVENT_STR_LENGTH] = "";
-    int i;
-    for (i = 0; i < eventLogNumberOfStoredEvents(); i++) {
-        eventLogRead( i, str );
-        pcSerialComStringWrite( str );   
-        pcSerialComStringWrite( "\r\n" );                    
-    }
-}
-\ No newline at end of file
diff --git a/modules/pc_serial_com/pc_serial_com.h b/modules/pc_serial_com/pc_serial_com.h
@@ -1,21 +0,0 @@
-//=====[#include guards - begin]===============================================
-
-#ifndef _PC_SERIAL_COM_H_
-#define _PC_SERIAL_COM_H_
-
-//=====[Declaration of public defines]=========================================
-
-//=====[Declaration of public data types]======================================
-
-//=====[Declarations (prototypes) of public functions]=========================
-
-void pcSerialComInit();
-char pcSerialComCharRead();
-void pcSerialComStringWrite( const char* str );
-void pcSerialComUpdate();
-bool pcSerialComCodeCompleteRead();
-void pcSerialComCodeCompleteWrite( bool state );
-
-//=====[#include guards - end]=================================================
-
-#endif // _PC_SERIAL_COM_H_
-\ No newline at end of file
diff --git a/modules/siren/siren.cpp b/modules/siren/siren.cpp
@@ -1,61 +0,0 @@
-//=====[Libraries]=============================================================
-
-#include "mbed.h"
-#include "arm_book_lib.h"
-
-#include "siren.h"
-
-#include "smart_home_system.h"
-
-//=====[Declaration of private defines]========================================
-
-//=====[Declaration of private data types]=====================================
-
-//=====[Declaration and initialization of public global objects]===============
-
-DigitalOut sirenPin(PE_10);
-
-//=====[Declaration of external public global variables]=======================
-
-//=====[Declaration and initialization of public global variables]=============
-
-//=====[Declaration and initialization of private global variables]============
-
-static bool sirenState = OFF;
-
-//=====[Declarations (prototypes) of private functions]========================
-
-//=====[Implementations of public functions]===================================
-
-void sirenInit()
-{
-    sirenPin = ON;
-}
-
-bool sirenStateRead()
-{
-    return sirenState;
-}
-
-void sirenStateWrite( bool state )
-{
-    sirenState = state;
-}
-
-void sirenUpdate( int strobeTime )
-{
-    static int accumulatedTimeAlarm = 0;
-    accumulatedTimeAlarm = accumulatedTimeAlarm + SYSTEM_TIME_INCREMENT_MS;
-    
-    if( sirenState ) {
-        if( accumulatedTimeAlarm >= strobeTime ) {
-                accumulatedTimeAlarm = 0;
-                sirenPin= !sirenPin;
-        }
-    } else {
-        sirenPin = ON;
-    }
-}
-
-//=====[Implementations of private functions]==================================
-
diff --git a/modules/siren/siren.h b/modules/siren/siren.h
@@ -1,19 +0,0 @@
-//=====[#include guards - begin]===============================================
-
-#ifndef _SIREN_H_
-#define _SIREN_H_
-
-//=====[Declaration of public defines]=========================================
-
-//=====[Declaration of public data types]======================================
-
-//=====[Declarations (prototypes) of public functions]=========================
-
-void sirenInit();
-bool sirenStateRead();
-void sirenStateWrite( bool state );
-void sirenUpdate( int strobeTime );
-
-//=====[#include guards - end]=================================================
-
-#endif // _SIREN_H_
diff --git a/modules/smart_home_system/smart_home_system.cpp b/modules/smart_home_system/smart_home_system.cpp
@@ -1,45 +0,0 @@
-//=====[Libraries]=============================================================
-
-#include "arm_book_lib.h"
-
-#include "smart_home_system.h"
-
-#include "siren.h"
-#include "user_interface.h"
-#include "fire_alarm.h"
-#include "pc_serial_com.h"
-#include "event_log.h"
-
-//=====[Declaration of private defines]========================================
-
-//=====[Declaration of private data types]=====================================
-
-//=====[Declaration and initialization of public global objects]===============
-
-//=====[Declaration of external public global variables]=======================
-
-//=====[Declaration and initialization of public global variables]=============
-
-//=====[Declaration and initialization of private global variables]============
-
-//=====[Declarations (prototypes) of private functions]========================
-
-//=====[Implementations of public functions]===================================
-
-void smartHomeSystemInit()
-{
-    userInterfaceInit();
-    fireAlarmInit();
-    pcSerialComInit();
-}
-
-void smartHomeSystemUpdate()
-{
-    userInterfaceUpdate();
-    fireAlarmUpdate();    
-    pcSerialComUpdate();
-    eventLogUpdate();
-    delay(SYSTEM_TIME_INCREMENT_MS);
-}
-
-//=====[Implementations of private functions]==================================
diff --git a/modules/smart_home_system/smart_home_system.h b/modules/smart_home_system/smart_home_system.h
@@ -1,19 +0,0 @@
-//=====[#include guards - begin]===============================================
-
-#ifndef _SMART_HOME_SYSTEM_H_
-#define _SMART_HOME_SYSTEM_H_
-
-//=====[Declaration of public defines]=========================================
-
-#define SYSTEM_TIME_INCREMENT_MS   10
-
-//=====[Declaration of public data types]======================================
-
-//=====[Declarations (prototypes) of public functions]=========================
-
-void smartHomeSystemInit();
-void smartHomeSystemUpdate();
-
-//=====[#include guards - end]=================================================
-
-#endif // _SMART_HOME_SYSTEM_H_
-\ No newline at end of file
diff --git a/modules/strobe_light/strobe_light.cpp b/modules/strobe_light/strobe_light.cpp
@@ -1,60 +0,0 @@
-//=====[Libraries]=============================================================
-
-#include "mbed.h"
-#include "arm_book_lib.h"
-
-#include "strobe_light.h"
-#include "smart_home_system.h"
-
-//=====[Declaration of private defines]========================================
-
-//=====[Declaration of private data types]=====================================
-
-//=====[Declaration and initialization of public global objects]===============
-
-DigitalOut strobeLight(LED1);
-
-//=====[Declaration of external public global variables]=======================
-
-//=====[Declaration and initialization of public global variables]=============
-
-//=====[Declaration and initialization of private global variables]============
-
-static bool strobeLightState = OFF;
-
-//=====[Declarations (prototypes) of private functions]========================
-
-//=====[Implementations of public functions]===================================
-
-void strobeLightInit()
-{
-    strobeLight = OFF;
-}
-
-bool strobeLightStateRead()
-{
-    return strobeLightState;
-}
-
-void strobeLightStateWrite( bool state )
-{
-    strobeLightState = state;
-}
-
-void strobeLightUpdate( int strobeTime )
-{
-    static int accumulatedTimeAlarm = 0;
-    accumulatedTimeAlarm = accumulatedTimeAlarm + SYSTEM_TIME_INCREMENT_MS;
-    
-    if( strobeLightState ) {
-        if( accumulatedTimeAlarm >= strobeTime ) {
-            accumulatedTimeAlarm = 0;
-            strobeLight= !strobeLight;
-        }
-    } else {
-        strobeLight = OFF;
-    }
-}
-
-//=====[Implementations of private functions]==================================
-
diff --git a/modules/strobe_light/strobe_light.h b/modules/strobe_light/strobe_light.h
@@ -1,19 +0,0 @@
-//=====[#include guards - begin]===============================================
-
-#ifndef _STROBE_LIGHT_H_
-#define _STROBE_LIGHT_H_
-
-//=====[Declaration of public defines]=========================================
-
-//=====[Declaration of public data types]======================================
-
-//=====[Declarations (prototypes) of public functions]=========================
-
-void strobeLightInit();
-bool strobeLightStateRead();
-void strobeLightStateWrite( bool state );
-void strobeLightUpdate( int strobeTime );
-
-//=====[#include guards - end]=================================================
-
-#endif // _STROBE_LIGHT_H_
-\ No newline at end of file
diff --git a/modules/temperature_sensor/temperature_sensor.cpp b/modules/temperature_sensor/temperature_sensor.cpp
@@ -1,86 +0,0 @@
-//=====[Libraries]=============================================================
-
-#include "mbed.h"
-
-#include "temperature_sensor.h"
-
-#include "smart_home_system.h"
-
-//=====[Declaration of private defines]========================================
-
-#define LM35_NUMBER_OF_AVG_SAMPLES    10
-
-//=====[Declaration of private data types]=====================================
-
-//=====[Declaration and initialization of public global objects]===============
-
-AnalogIn lm35(A1);
-
-//=====[Declaration of external public global variables]=======================
-
-//=====[Declaration and initialization of public global variables]=============
-
-//=====[Declaration and initialization of private global variables]============
-
-float lm35TemperatureC = 0.0;
-float lm35ReadingsArray[LM35_NUMBER_OF_AVG_SAMPLES];
-
-//=====[Declarations (prototypes) of private functions]========================
-
-static float analogReadingScaledWithTheLM35Formula( float analogReading );
-
-//=====[Implementations of public functions]===================================
-
-void temperatureSensorInit()
-{
-    int i;
-    
-    for( i=0; i<LM35_NUMBER_OF_AVG_SAMPLES ; i++ ) {
-        lm35ReadingsArray[i] = 0;
-    }
-}
-
-void temperatureSensorUpdate()
-{
-    static int lm35SampleIndex = 0;
-    float lm35ReadingsSum = 0.0;
-    float lm35ReadingsAverage = 0.0;
-
-    int i = 0;
-
-    lm35ReadingsArray[lm35SampleIndex] = lm35.read();
-       lm35SampleIndex++;
-    if ( lm35SampleIndex >= LM35_NUMBER_OF_AVG_SAMPLES) {
-        lm35SampleIndex = 0;
-    }
-    
-   lm35ReadingsSum = 0.0;
-    for (i = 0; i < LM35_NUMBER_OF_AVG_SAMPLES; i++) {
-        lm35ReadingsSum = lm35ReadingsSum + lm35ReadingsArray[i];
-    }
-    lm35ReadingsAverage = lm35ReadingsSum / LM35_NUMBER_OF_AVG_SAMPLES;
-       lm35TemperatureC = analogReadingScaledWithTheLM35Formula ( lm35ReadingsAverage );    
-}
-
-
-float temperatureSensorReadCelsius()
-{
-    return lm35TemperatureC;
-}
-
-float temperatureSensorReadFahrenheit()
-{
-    return celsiusToFahrenheit( lm35TemperatureC );
-}
-
-float celsiusToFahrenheit( float tempInCelsiusDegrees )
-{
-    return ( tempInCelsiusDegrees * 9.0 / 5.0 + 32.0 );
-}
-
-//=====[Implementations of private functions]==================================
-
-static float analogReadingScaledWithTheLM35Formula( float analogReading )
-{
-    return ( analogReading * 3.3 / 0.01 );
-}
diff --git a/modules/temperature_sensor/temperature_sensor.h b/modules/temperature_sensor/temperature_sensor.h
@@ -1,20 +0,0 @@
-//=====[#include guards - begin]===============================================
-
-#ifndef _TEMPERATURE_SENSOR_H_
-#define _TEMPERATURE_SENSOR_H_
-
-//=====[Declaration of public defines]=========================================
-
-//=====[Declaration of public data types]======================================
-
-//=====[Declarations (prototypes) of public functions]=========================
-
-void temperatureSensorInit();
-void temperatureSensorUpdate();
-float temperatureSensorReadCelsius();
-float temperatureSensorReadFahrenheit();
-float celsiusToFahrenheit( float tempInCelsiusDegrees );
-
-//=====[#include guards - end]=================================================
-
-#endif // _TEMPERATURE_SENSOR_H_
-\ No newline at end of file
diff --git a/modules/user_interface/user_interface.cpp b/modules/user_interface/user_interface.cpp
@@ -1,192 +0,0 @@
-//=====[Libraries]=============================================================
-
-#include "mbed.h"
-#include "arm_book_lib.h"
-
-#include "user_interface.h"
-
-#include "code.h"
-#include "siren.h"
-#include "smart_home_system.h"
-#include "fire_alarm.h"
-#include "date_and_time.h"
-#include "temperature_sensor.h"
-#include "gas_sensor.h"
-#include "matrix_keypad.h"
-#include "display.h"
-
-//=====[Declaration of private defines]========================================
-
-#define DISPLAY_REFRESH_TIME_MS 1000
-
-//=====[Declaration of private data types]=====================================
-
-//=====[Declaration and initialization of public global objects]===============
-
-DigitalOut incorrectCodeLed(LED3);
-DigitalOut systemBlockedLed(LED2);
-
-//=====[Declaration of external public global variables]=======================
-
-//=====[Declaration and initialization of public global variables]=============
-
-char codeSequenceFromUserInterface[CODE_NUMBER_OF_KEYS];
-
-//=====[Declaration and initialization of private global variables]============
-
-static bool incorrectCodeState = OFF;
-static bool systemBlockedState = OFF;
-
-static bool codeComplete = false;
-static int numberOfCodeChars = 0;
-
-//=====[Declarations (prototypes) of private functions]========================
-
-static void userInterfaceMatrixKeypadUpdate();
-static void incorrectCodeIndicatorUpdate();
-static void systemBlockedIndicatorUpdate();
-
-static void userInterfaceDisplayInit();
-static void userInterfaceDisplayUpdate();
-
-//=====[Implementations of public functions]===================================
-
-void userInterfaceInit()
-{
-    incorrectCodeLed = OFF;
-    systemBlockedLed = OFF;
-    matrixKeypadInit( SYSTEM_TIME_INCREMENT_MS );
-    userInterfaceDisplayInit();
-}
-
-void userInterfaceUpdate()
-{
-    userInterfaceMatrixKeypadUpdate();
-    incorrectCodeIndicatorUpdate();
-    systemBlockedIndicatorUpdate();
-    userInterfaceDisplayUpdate();
-}
-
-bool incorrectCodeStateRead()
-{
-    return incorrectCodeState;
-}
-
-void incorrectCodeStateWrite( bool state )
-{
-    incorrectCodeState = state;
-}
-
-bool systemBlockedStateRead()
-{
-    return systemBlockedState;
-}
-
-void systemBlockedStateWrite( bool state )
-{
-    systemBlockedState = state;
-}
-
-bool userInterfaceCodeCompleteRead()
-{
-    return codeComplete;
-}
-
-void userInterfaceCodeCompleteWrite( bool state )
-{
-    codeComplete = state;
-}
-
-//=====[Implementations of private functions]==================================
-
-static void userInterfaceMatrixKeypadUpdate()
-{
-    static int numberOfHashKeyReleased = 0;
-    char keyReleased = matrixKeypadUpdate();
-
-    if( keyReleased != '\0' ) {
-
-        if( sirenStateRead() && !systemBlockedStateRead() ) {
-            if( !incorrectCodeStateRead() ) {
-                codeSequenceFromUserInterface[numberOfCodeChars] = keyReleased;
-                numberOfCodeChars++;
-                if ( numberOfCodeChars >= CODE_NUMBER_OF_KEYS ) {
-                    codeComplete = true;
-                    numberOfCodeChars = 0;
-                }
-            } else {
-                if( keyReleased == '#' ) {
-                    numberOfHashKeyReleased++;
-                    if( numberOfHashKeyReleased >= 2 ) {
-                        numberOfHashKeyReleased = 0;
-                        numberOfCodeChars = 0;
-                        codeComplete = false;
-                        incorrectCodeState = OFF;
-                    }
-                }
-            }
-        }
-    }
-}
-
-static void userInterfaceDisplayInit()
-{
-    displayInit( DISPLAY_CONNECTION_GPIO_4BITS );
-     
-    displayCharPositionWrite ( 0,0 );
-    displayStringWrite( "Temperature:" );
-
-    displayCharPositionWrite ( 0,1 );
-    displayStringWrite( "Gas:" );
-    
-    displayCharPositionWrite ( 0,2 );
-    displayStringWrite( "Alarm:" );
-}
-
-static void userInterfaceDisplayUpdate()
-{
-    static int accumulatedDisplayTime = 0;
-    char temperatureString[3] = "";
-    
-    if( accumulatedDisplayTime >=
-        DISPLAY_REFRESH_TIME_MS ) {
-
-        accumulatedDisplayTime = 0;
-
-        sprintf(temperatureString, "%.0f", temperatureSensorReadCelsius());
-        displayCharPositionWrite ( 12,0 );
-        displayStringWrite( temperatureString );
-        displayCharPositionWrite ( 14,0 );
-        displayStringWrite( "'C" );
-
-        displayCharPositionWrite ( 4,1 );
-
-        if ( gasDetectorStateRead() ) {
-            displayStringWrite( "Detected    " );
-        } else {
-            displayStringWrite( "Not Detected" );
-        }
-
-        displayCharPositionWrite ( 6,2 );
-        
-        if ( sirenStateRead() ) {
-            displayStringWrite( "ON " );
-        } else {
-            displayStringWrite( "OFF" );
-        }
-
-    } else {
-        accumulatedDisplayTime =
-            accumulatedDisplayTime + SYSTEM_TIME_INCREMENT_MS;        
-    } 
-}
-
-static void incorrectCodeIndicatorUpdate()
-{
-    incorrectCodeLed = incorrectCodeStateRead();
-}
-
-static void systemBlockedIndicatorUpdate()
-{
-    systemBlockedLed = systemBlockedState;
-}
-\ No newline at end of file
diff --git a/modules/user_interface/user_interface.h b/modules/user_interface/user_interface.h
@@ -1,25 +0,0 @@
-//=====[#include guards - begin]===============================================
-
-#ifndef _USER_INTERFACE_H_
-#define _USER_INTERFACE_H_
-
-//=====[Declaration of public defines]=========================================
-
-//=====[Declaration of public data types]======================================
-
-//=====[Declarations (prototypes) of public functions]=========================
-
-void userInterfaceInit();
-void userInterfaceUpdate();
-bool userInterfaceCodeCompleteRead();
-void userInterfaceCodeCompleteWrite( bool state );
-
-bool incorrectCodeStateRead();
-void incorrectCodeStateWrite( bool state );
-
-bool systemBlockedStateRead();
-void systemBlockedStateWrite( bool state );
-
-//=====[#include guards - end]=================================================
-
-#endif // _USER_INTERFACE_H_
-\ No newline at end of file