#include "lcd.h" //Declaratons for LCD #include "i2c.h" #include "ds3231.h" //Declarations for RTC #ifdef ADC #include "adc.h" //Declarations for ADC #endif #include "beep.h" //Declarations for BEEP #ifdef DEBUG #include "uart.h" //Declarations for UART #include "term.h" //Declarations for Escape codes #endif #ifdef ADC // Declare variable for LDR unsigned int ldr; #endif // Declare variables for VFD brightness level #define brtlvl ldr/256 unsigned int brtlvl_chg; // Update to 1 if RB0 interrupt occurs, otherwise 0 unsigned int update; // Boolean if setting time manually with user input unsigned int edit_datetime; // Declare variables for date time and alarms extern unsigned int sec; extern unsigned int min; extern unsigned int hour; extern unsigned int day; extern unsigned int date; extern unsigned int month; extern unsigned int year; extern unsigned int century; extern unsigned int alarm1_sec, alarm1_min, alarm1_hour; extern unsigned int alarm2_min, alarm2_hour; extern unsigned int status_reg, alarm1_status, alarm2_status; extern unsigned int control_reg; // Declare variables for temperature extern unsigned int temperature_lsb; extern int temperature_msb; unsigned char temp_sign; // Define MSB / LSB: Useful for separating into chars for tens and ones places #define LSB(x) ((x % 10) + '0') // x >> 4 #define MSB(x) ((x / 10) + '0') // x & 0x0F #ifdef DEBUG #include // included for sprintf // Declare a variable to use as a buffer for sprintf char buf[40]; #endif void display_Digit(unsigned int); void display_Intro(void); void display_Lcd_Layout(void); void edit_Date_Time(void); // Format msb and lsb for temperature display void format_Temperature(void); // Determine Alarm status from control registers void Get_Alarm_Status(void); void update_Display(void);