lcd
Dependencies: LCD_DISCO_F469NI TS_DISCO_F469NI F469_GUI BSP_DISCO_F469NI
Diff: main.cpp
- Revision:
- 1:222362fa4bea
- Parent:
- 0:0a8891401c4f
--- a/main.cpp Sun Oct 23 16:00:40 2016 +0000
+++ b/main.cpp Wed Feb 20 09:24:35 2019 +0000
@@ -14,8 +14,8 @@
Label obj12(400, 32, "SeekBar, SeekbarGroup",
Label::CENTER);
- Button button1(10, 54, 50, 40, "1");
- Button button2(62, 54, 50, 40, "2");
+ Button button1(10, 300, 80, 60, "1");
+ Button button2(95, 300, 80, 60, "2");
const int NUMBER_BUTTONS = 4;
const string STR1[NUMBER_BUTTONS] = {"Button1", "Button2", "Button3", "Activate"};
@@ -36,7 +36,7 @@
LCD_COLOR_DARKGREEN, LCD_COLOR_RED);
// Using default value for argument (Horizontal)
- SeekBar barH(20, 250, 200, -5, 5, 0, "-5", "", "5");
+ SeekBar barH(20, 250, 200, -5, 5, 0, "-5", "0", "5");
NumericLabel<float> numLabel1(80, 205, "%5.1f", barH.GetValue());
NumericLabel<int> numLabel2(130, 205, "%3d", (int)barH.GetValue());
NumericLabel<int> numLabel3(160, 205);
@@ -54,11 +54,22 @@
Label leftJustified(420, 54, "ABC", Label::LEFT);
Label centerJustified(420, 64, "ABC", Label::CENTER);
Label rightJustified1(420, 74, "ABC", Label::RIGHT);
-
+ unsigned char flag=0;
+ unsigned tab [2]={0x0000FF,0x00FF00};
while (true)
{
- if (button1.Touched()) button2.Draw();
- if (button2.Touched()) button1.Draw();
+ if (button1.Touched()){
+ if(flag==0){
+ flag=1;
+ }else{
+ button1.Draw();
+ flag=0;
+ }
+ }
+ if (button2.Touched()){
+ unsigned int v= (unsigned)(((barH.GetValue()+5)*255)/10)<<24;
+ button2.Draw((unsigned)(tab[flag]+v));
+ }
int num;
if (bGroup1.GetTouchedNumber(num))