Lionel Medzo Owono / Mbed 2 deprecated Projet_MBED_TEMPERATURE

Dependencies:   TS_DISCO_F746NG mbed LCD_DISCO_F746NG BSP_DISCO_F746NG MCP9808 BUTTON_GROUP

Files at this revision

API Documentation at this revision

Comitter:
MikamiUitOpen
Date:
Wed Dec 23 07:25:23 2015 +0000
Parent:
5:ab0913c1557a
Child:
7:cd3ef8345659
Commit message:
7

Changed in this revision

BUTTON_GROUP.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
--- a/BUTTON_GROUP.lib	Fri Dec 11 14:23:39 2015 +0000
+++ b/BUTTON_GROUP.lib	Wed Dec 23 07:25:23 2015 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/MikamiUitOpen/code/BUTTON_GROUP/#6913aebb3905
+http://mbed.org/users/MikamiUitOpen/code/BUTTON_GROUP/#479ed9f0ba20
--- a/main.cpp	Fri Dec 11 14:23:39 2015 +0000
+++ b/main.cpp	Wed Dec 23 07:25:23 2015 +0000
@@ -1,7 +1,7 @@
 //---------------------------------------------------------------
 //  Demo program of Button class and ButtonGroup class
 //
-//  2015/12/09, Copyright (c) 2015 MIKAMI, Naoki
+//  2015/12/32, Copyright (c) 2015 MIKAMI, Naoki
 //---------------------------------------------------------------
 
 #include "button_group.hpp"
@@ -17,30 +17,31 @@
     const int X1 = 30;
     const int Y1 = 100;
 
-    uint32_t backColor = 0xFF006A6C;            // teal green
-    uint32_t inActive = backColor & 0xE0FFFFFF; // color for inactive button
-    lcd_.Clear(backColor);
+    const uint32_t BACK_COLOR = 0xFF006A6C;             // teal green
+    const uint32_t INACTIVE = BACK_COLOR & 0xE0FFFFFF;  // color for inactive button
+    lcd_.Clear(BACK_COLOR);
        
     const int NUMBER_BUTTONS = 4;
     const string STR[NUMBER_BUTTONS] = {"Button1", "Button2", "Button3", "Button4"};
     ButtonGroup bGroup(lcd_, ts_, 10, Y0, 66, 40,
-                       LCD_COLOR_BLUE, backColor, NUMBER_BUTTONS, STR, 5, 5, 3);
+                       LCD_COLOR_BLUE, BACK_COLOR, NUMBER_BUTTONS, STR, 5, 5, 3);
                        
     const string STR_SW[2] = {"ON", "OFF"};
     ButtonGroup sw(lcd_, ts_, 10, 160, 66, 40,
-                   LCD_COLOR_GREEN, backColor, 2, STR_SW, 5, 0, 2);
+                   LCD_COLOR_GREEN, BACK_COLOR, 2, STR_SW, 5, 0, 2);
                        
     Button Large(lcd_, ts_, 280, 100, 120, 60,
-                 LCD_COLOR_GREEN, backColor, "LARGE", Font24);
+                 LCD_COLOR_GREEN, BACK_COLOR, "LARGE", Font24);
     
     Button reset(lcd_, ts_, 410, Y0, 60, 40,
-                 LCD_COLOR_BLUE, backColor, "Reset", Font12);
-    reset.Draw(inActive, LCD_COLOR_GRAY);
+                 LCD_COLOR_BLUE, BACK_COLOR, "Reset", Font12);
+    reset.Draw(INACTIVE, LCD_COLOR_GRAY);
 
     lcd_.SetTextColor(LCD_COLOR_WHITE);
+    lcd_.DisplayStringAt(100, 260, (uint8_t *)"12/23 16:20", LEFT_MODE);
+    int num;
     while (true)
     {
-        int num;
         if (bGroup.GetTouchedNumber(num, LCD_COLOR_DARKBLUE))
         {
             char str[20];
@@ -60,7 +61,7 @@
         if (reset.Touched())
         {
             bGroup.Redraw(num);
-            reset.Draw(inActive, LCD_COLOR_GRAY);
+            reset.Draw(INACTIVE, LCD_COLOR_GRAY);
             lcd_.SetFont(&Font16);
             lcd_.DisplayStringAt(X1, Y1, (uint8_t *)"               ", LEFT_MODE);
         }