Tim Clune / Mbed 2 deprecated DISCO_F429ZI_display_time

Dependencies:   BSP_DISCO_F429ZI LCD_DISCO_F429ZI mbed

Files at this revision

API Documentation at this revision

Comitter:
PH_TIMC
Date:
Fri Oct 19 22:08:58 2018 +0000
Parent:
1:361a24c01ed7
Commit message:
Discovery F429ZI displays time on the LCD

Changed in this revision

BSP_DISCO_F429ZI.lib Show annotated file Show diff for this revision Revisions of this file
LCD_DISCO_F429ZI.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 361a24c01ed7 -r 72d0921572b1 BSP_DISCO_F429ZI.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BSP_DISCO_F429ZI.lib	Fri Oct 19 22:08:58 2018 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/ST/code/BSP_DISCO_F429ZI/#e1d164542663
diff -r 361a24c01ed7 -r 72d0921572b1 LCD_DISCO_F429ZI.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LCD_DISCO_F429ZI.lib	Fri Oct 19 22:08:58 2018 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/ST/code/LCD_DISCO_F429ZI/#dc55a068bc1a
diff -r 361a24c01ed7 -r 72d0921572b1 main.cpp
--- a/main.cpp	Wed Jun 07 12:53:31 2017 +0000
+++ b/main.cpp	Fri Oct 19 22:08:58 2018 +0000
@@ -1,24 +1,32 @@
 #include "mbed.h"
+#include "LCD_DISCO_F429ZI.h"
 
+LCD_DISCO_F429ZI lcd;
 DigitalOut myled(LED1);
 
 int main() {
     
     printf("RTC example\n"); 
-    set_time(1387188323); // Set RTC time to 16 December 2013 10:05:23 UTC
+    set_time(1539982753);  // Set RTC time to Friday, October 19, 2018 1:59:13 PM GMT-07:00 DST
     printf("Date and time are set.\n");
+    BSP_LCD_SetFont(&Font12);
 
     while(1) {
 
+wait(2.0);
+    lcd.Clear(LCD_COLOR_BLUE);
+    lcd.SetBackColor(LCD_COLOR_BLUE);
+    lcd.SetTextColor(LCD_COLOR_WHITE);
+    wait(0.3);
+    lcd.DisplayStringAt(0, LINE(4), (uint8_t *)"DISCOVERY", CENTER_MODE);
+    lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"STM32F429ZI", CENTER_MODE);
+    lcd.DisplayStringAt(0, LINE(6), (uint8_t *)"Test Nucleo", CENTER_MODE);
+    lcd.DisplayStringAt(0, LINE(7), (uint8_t *)"RTC Function", CENTER_MODE);
+    wait(1);
+
         time_t seconds = time(NULL);
 
-        //printf("Time as seconds since January 1, 1970 = %d\n", seconds);
-        
-        printf("Time as a basic string = %s", ctime(&seconds));
-
-        //char buffer[32];
-        //strftime(buffer, 32, "%I:%M:%S %p\n", localtime(&seconds));
-        //printf("Time as a custom formatted string = %s", buffer);
+        lcd.DisplayStringAt(0, LINE(9), (uint8_t *)ctime(&seconds), CENTER_MODE);        
 
         myled = !myled;      
         wait(1);