diff options
-rwxr-xr-x | conf.h | 3 | ||||
-rwxr-xr-x | lcd.c | 11 | ||||
-rwxr-xr-x | main.c | 10 | ||||
-rwxr-xr-x | main.h | 2 |
4 files changed, 23 insertions, 3 deletions
@@ -17,6 +17,9 @@ // Define baud rate of 9600
#define Baud_rate 9600
+// Define if VFD if used
+#define VFD 1
+
// HD44780
#define RS RD2 // Register Select on RD2
#define EN RD3 // Enable on RD3
@@ -65,6 +65,9 @@ void Lcd_Init() { Lcd_Cmd(0x03);
/////////////////////////////////////////////////////
Lcd_Cmd(0x02);
+#ifdef VFD
+ Vfd_Set_Brightness(0); //Set brightness to max
+#endif
Lcd_Cmd(0x02);
Lcd_Cmd(0x08);
Lcd_Cmd(0x00);
@@ -105,6 +108,12 @@ void Lcd_Shift_Left() { }
// For some VFD's like Noritake
+
void Vfd_Set_Brightness(int level) {
-
+ Lcd_Cmd(0x03);
+ __delay_ms(11);
+ Lcd_Cmd(0x03);
+ /////////////////////////////////////////////////////
+ Lcd_Cmd(0x02);
+ Lcd_Write_Char(level);
}
\ No newline at end of file @@ -46,6 +46,10 @@ int main() { UART_send_string(CLRATTR); // No color
#endif
+#ifdef VFD
+ Vfd_Set_Brightness(0); //Max brightness 3 - minimum
+#endif
+
display_Intro();
display_Lcd_Layout();
@@ -53,7 +57,7 @@ int main() { //Set_Time_Date();
//Set_Time();
//Set_Date();
- //Set_DayOfWeek();
+ Set_DayOfWeek();
// Write default alarm values
@@ -65,6 +69,10 @@ int main() { UART_send_string("Writing Alarms\r\n");
Write_Alarms();*/
+#ifdef VFD
+ Vfd_Set_Brightness(3); //Max brightness 3 - minimum
+#endif
+
while (1) {
// Set time and date variables from DS3231
@@ -2,7 +2,7 @@ unsigned int sec = 30;
unsigned int min = 42;
unsigned int hour = 21;
-unsigned int dayOfWeek = 7;
+unsigned int dayOfWeek = 1;
unsigned int date = 27;
unsigned int month = 7;
unsigned int year = 19;
|