Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dashboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
egorguslyan
Dashboard
Commits
66c11af4
Commit
66c11af4
authored
3 years ago
by
egorguslyan
Browse files
Options
Downloads
Patches
Plain Diff
Strings
parent
8427289b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Dashboard/Dashboard.ino
+1
-3
1 addition, 3 deletions
Dashboard/Dashboard.ino
Dashboard/config.h
+2
-0
2 additions, 0 deletions
Dashboard/config.h
Dashboard/screens.h
+50
-4
50 additions, 4 deletions
Dashboard/screens.h
Dashboard/strings.h
+14
-3
14 additions, 3 deletions
Dashboard/strings.h
with
67 additions
and
10 deletions
Dashboard/Dashboard.ino
+
1
−
3
View file @
66c11af4
...
@@ -70,10 +70,8 @@ struct
...
@@ -70,10 +70,8 @@ struct
uint64_t
timer
;
uint64_t
timer
;
}
globalVars
;
}
globalVars
;
#include
"screens.h"
#include
"config.h"
microLED
<
numLeds
,
LEDsPin
,
MLED_NO_CLOCK
,
LED_WS2812
,
ORDER_GRB
,
CLI_AVER
/*, SAVE_MILLIS*/
>
matrix
(
WIDTH
,
HEIGHT
,
ZIGZAG
,
RIGHT_TOP
,
DIR_LEFT
);
microLED
<
numLeds
,
LEDsPin
,
MLED_NO_CLOCK
,
LED_WS2812
,
ORDER_GRB
,
CLI_AVER
/*, SAVE_MILLIS*/
>
matrix
(
WIDTH
,
HEIGHT
,
ZIGZAG
,
RIGHT_TOP
,
DIR_LEFT
);
#include
"config.h"
#include
"textbox.h"
#include
"textbox.h"
textbox
tb
;
textbox
tb
;
MHZ19_uart
co2
;
MHZ19_uart
co2
;
...
...
This diff is collapsed.
Click to expand it.
Dashboard/config.h
+
2
−
0
View file @
66c11af4
...
@@ -13,6 +13,8 @@
...
@@ -13,6 +13,8 @@
#define startWith SCREEN_WELCOME
#define startWith SCREEN_WELCOME
#include
"screens.h"
// Links
// Links
enum
SCREENS
enum
SCREENS
{
{
...
...
This diff is collapsed.
Click to expand it.
Dashboard/screens.h
+
50
−
4
View file @
66c11af4
#include
"strings.h"
void
welcome
(
Arg
*
arg
);
void
welcome
(
Arg
*
arg
);
void
dashboard
(
Arg
*
arg
);
void
dashboard
(
Arg
*
arg
);
void
welcome
(
Arg
*
arg
)
void
welcome
(
Arg
*
arg
)
{
{
const
uint8_t
delayMap
[]
=
{
50
};
const
uint16_t
delayMap
[]
=
{
50
};
// Local vars
static
uint8_t
counter
=
0
;
if
(
millis
()
-
globalVars
.
timer
>
delayMap
[
globalVars
.
currentState
])
if
(
millis
()
-
globalVars
.
timer
>
delayMap
[
globalVars
.
currentState
])
digitalWrite
(
13
,
1
);
{
globalVars
.
timer
=
millis
();
switch
(
globalVars
.
currentState
)
{
// Init
case
0
:
counter
=
0
;
globalVars
.
currentState
++
;
break
;
// Fill borders
case
1
:
uint8_t
x
=
counter
<
WIDTH
?
(
counter
)
:
(
counter
<
WIDTH
+
HEIGHT
-
1
?
(
WIDTH
-
1
)
:
(
counter
<
2
*
WIDTH
+
HEIGHT
-
2
?
(
2
*
WIDTH
-
counter
+
HEIGHT
-
2
)
:
(
0
)));
uint8_t
y
=
counter
<
WIDTH
?
(
0
)
:
(
counter
<
WIDTH
+
HEIGHT
-
1
?
(
counter
-
WIDTH
+
1
)
:
(
counter
<
2
*
WIDTH
+
HEIGHT
-
2
?
(
HEIGHT
-
1
)
:
(
2
*
HEIGHT
-
counter
+
2
*
WIDTH
-
3
)));
matrix
.
set
(
x
,
y
,
COLOR1
);
matrix
.
show
();
counter
+=
1
;
if
(
counter
==
2
*
(
WIDTH
+
HEIGHT
)
-
4
)
globalVars
.
currentState
++
;
break
;
case
2
:
// EEPROM read here
tb
.
setup
(,
COLOR2
,
TB_REPEAT
,
1
,
1
,
14
,
100
);
globalVars
.
currentState
++
;
break
;
}
}
}
}
void
dashboard
(
Arg
*
arg
)
void
dashboard
(
Arg
*
arg
)
{
{
const
uint8_t
delayMap
[]
=
{
50
};
const
uint16_t
delayMap
[]
=
{
50
};
if
(
millis
()
-
globalVars
.
timer
>
delayMap
[
globalVars
.
currentState
])
if
(
millis
()
-
globalVars
.
timer
>
delayMap
[
globalVars
.
currentState
])
digitalWrite
(
13
,
1
);
{
globalVars
.
timer
=
millis
();
switch
(
globalVars
.
currentState
)
{
case
0
:
//
break
;
}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Dashboard/strings.h
+
14
−
3
View file @
66c11af4
#if LANG_RU_RU
#if LANG_RU_RU
char
*
strings
[]
=
{};
#define LANGMASK(n) langmask[n]
const
char
hello
[]
PROGMEM
=
"Привет"
;
const
char
start_prompt
[]
PROGMEM
=
"<- Свайпни влево"
;
const
char
pomodoro
[]
PROGMEM
=
"Помидор"
;
const
char
set_time
[]
PROGMEM
=
"Установи время"
;
const
uint64_t
langmask
[]
PROGMEM
=
{
0xFF
,
0x1FFF
,
0xFF
,
0xFFFF
};
#else
#else
char
*
strings
[]
=
{
"Hello"
,
"<- Swipe left"
};
#define LANGMASK(n) 0
#endif
const
char
hello
[]
PROGMEM
=
"Hello"
;
\ No newline at end of file
const
char
start_prompt
[]
PROGMEM
=
"<- Swipe left"
;
const
char
pomodoro
[]
PROGMEM
=
"Pomodoro"
;
const
char
set_time
[]
PROGMEM
=
"Set time"
;
#endif
const
char
*
const
strings
[]
=
{
hello
,
start_prompt
,
pomodoro
,
set_time
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment