pyrocommander

Dependencies:   Fonts LCD_DISCO_F746NG TS_DISCO_F746NG debug mbed

Revision:
1:e46a729c44db
Parent:
0:9950b0e13bf3
Child:
2:139a3cbac2d9
--- a/main.cpp	Sat Mar 12 21:54:28 2016 +0000
+++ b/main.cpp	Sun Mar 13 09:25:53 2016 +0000
@@ -1,32 +1,59 @@
+// PYROCOMMANDER
+// STM32F746NG
 #include "mbed.h"
 #include "LCD_DISCO_F746NG.h"
-//#include "stm32746g_discovery_lcd.h"
-//#include "fonts.h"
+#include "stm32746g_discovery_lcd.h"
+#include "TS_DISCO_F746NG.h"
+#include "fonts.h"
+#include "FontX.h"
+#include "Digital16x31.h" 
 
+#define FramesPerSecond 25
 
-//LCD_DISCO_F746NG lcd;
+LCD_DISCO_F746NG lcd;
+TS_DISCO_F746NG ts;
+
 DigitalOut led1(LED1);
-#define FramesPerSecond 25
+
 char textBuf[12];
+char getal [10];
 int h = 0;
 int m = 0;
 int s = 0;
 int f = 0;
 unsigned long FRAMES_IN_HOUR = 3600 * FramesPerSecond;
 unsigned long FRAMES_IN_MINUTE = 60 * FramesPerSecond;
+unsigned long x = 0;
+
 
 int main()
 {
     led1 = 1;
-    unsigned long x = 0;
-//    lcd.SetBackColor(LCD_COLOR_BLACK);
-//    lcd.SetTextColor(LCD_COLOR_WHITE);
-//    lcd.DrawRect(1, 1, 475, 270);
-//    lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"www.Pyrocommander.com", CENTER_MODE);
-//    lcd.SetBackColor(LCD_COLOR_RED);
-//    lcd.SetTextColor(LCD_COLOR_YELLOW);
+    lcd.Clear(LCD_COLOR_DARKBLUE);
+    lcd.SetBackColor(LCD_COLOR_DARKBLUE);
+    lcd.SetTextColor(LCD_COLOR_WHITE);
+    lcd.SetFont(&Font16);
+    lcd.DisplayStringAt(0, LINE(1), (uint8_t *)"www.Pyrocommander.com", CENTER_MODE);
+    lcd.SetTextColor(LCD_COLOR_WHITE);
+    lcd.DrawRect(1, 1, 478, 270);
+    lcd.SetBackColor(LCD_COLOR_DARKRED);
+    lcd.SetTextColor(LCD_COLOR_YELLOW);
+    lcd.SetFont(&Font8);
+    lcd.DisplayStringAt(20, LINE(30), (uint8_t *)"Rdk Systems", RIGHT_MODE);
+    lcd.SetBackColor(LCD_COLOR_DARKBLUE);
+    lcd.SetTextColor(LCD_COLOR_WHITE);
+    lcd.SetFont(&Font24);
+    lcd.DisplayStringAt(20, LINE(5), (uint8_t *)"Actual Time :", LEFT_MODE);
+    lcd.SetBackColor(LCD_COLOR_DARKBLUE);
+    lcd.SetTextColor(LCD_COLOR_LIGHTBLUE);
+    lcd.SetFont(&Font16);
+    lcd.DisplayStringAt(90, LINE(12), (uint8_t *)"Total Frames :", LEFT_MODE);
+    lcd.SetBackColor(LCD_COLOR_DARKRED);
+    lcd.SetTextColor(LCD_COLOR_YELLOW);
+    lcd.SetFont(&Font24);
+    lcd.SetFont(&Digital16x31);
+
     while(1) {
-        //wait(0.040);
         wait_ms (40);
         x++;
         h = (int) (x / FRAMES_IN_HOUR);
@@ -34,7 +61,16 @@
         s = (int) (((x % FRAMES_IN_HOUR) % FRAMES_IN_MINUTE) / FramesPerSecond);
         f = (((x % FRAMES_IN_HOUR) % FRAMES_IN_MINUTE) % FramesPerSecond);
         sprintf(textBuf,"%02d:%02d:%02d:%02d", h,m,s,f);
-//        lcd.DisplayStringAt(50, LINE(5), (uint8_t *)textBuf, LEFT_MODE);
+        sprintf(getal,"%010d", x);
+
+        lcd.SetBackColor(LCD_COLOR_DARKRED);
+        lcd.SetTextColor(LCD_COLOR_YELLOW);
+        lcd.SetFont(&Font24);
+        lcd.DisplayStringAt(270, LINE(5), (uint8_t *)textBuf, LEFT_MODE);
+        lcd.SetBackColor(LCD_COLOR_DARKBLUE);
+        lcd.SetTextColor(LCD_COLOR_YELLOW);
+        lcd.SetFont(&Font16);
+        lcd.DisplayStringAt(270, LINE(12), (uint8_t *) getal, LEFT_MODE);
         led1 = !led1;
     }
 }