Skip to content
Snippets Groups Projects
Commit 66c11af4 authored by egorguslyan's avatar egorguslyan
Browse files

Strings

parent 8427289b
No related branches found
No related tags found
No related merge requests found
...@@ -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;
......
...@@ -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
{ {
......
#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
#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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment