#include <GyverOLED.h>
bool _count1I = 0;
unsigned long _count1_Value = 0UL;
bool _gen1I = 0;
bool _gen1O = 0;
unsigned long _gen1P = 0UL;
GyverOLED<SSD1306_128x64 > oled;
String customText69211207;
bool rTrig69211207 = false;
char prev_buf69211207[33] = "";
String customText104661083;
bool rTrig104661083 = false;
char prev_buf104661083[33] = "";
void setup()
{
oled.init();
oled.clear();
}
void loop()
{
oled.clear();
//Плата:1
if((1))
{
char buf69211207[33];
String myString69211207 = (String("12345"));
myString69211207.toCharArray(buf69211207, 33);
customText69211207 = buf69211207;
customText69211207.toCharArray(buf69211207, 33);
if(strcmp(prev_buf69211207, buf69211207) != 0)
{
//oled.clear();
strcpy(prev_buf69211207, buf69211207);
}
oled.setCursorXY((0), (0));
oled.textMode(BUF_ADD);
oled.setScale(2);
oled.invertText(0);
oled.autoPrintln(0);
oled.print(buf69211207);
//oled.update();
rTrig69211207 = true;
}
else if (rTrig69211207)
{
//oled.clear();
rTrig69211207 = false;
}
if (1)
{
if (! _gen1I)
{
_gen1I = 1;
_gen1O = 1;
_gen1P = millis();
}
}
else
{
_gen1I = 0 ;
_gen1O= 0;
}
if (_gen1I)
{
if (_isTimer (_gen1P , 1000))
{
_gen1P = millis();
_gen1O = ! _gen1O;
}
}
if (_gen1O)
{
if (! _count1I)
{
_count1I = 1;
_count1_Value = _count1_Value + 1;
}
}
else
{
_count1I = 0;
}
if(_count1_Value >= 10)
{
_count1_Value = 0;
}
if((1))
{
char buf104661083[33];
String myString104661083 = ((String(_count1_Value, DEC)));
myString104661083.toCharArray(buf104661083, 33);
customText104661083 = buf104661083;
customText104661083.toCharArray(buf104661083, 33);
if(strcmp(prev_buf104661083, buf104661083) != 0)
{
//oled.clear();
strcpy(prev_buf104661083, buf104661083);
}
oled.setCursorXY((0), (20));
oled.textMode(BUF_ADD);
oled.setScale(2);
oled.invertText(0);
oled.autoPrintln(0);
oled.print(buf104661083);
//oled.update();
rTrig104661083 = true;
}
else if (rTrig104661083)
{
//oled.clear();
rTrig104661083 = false;
}
oled.update();
}
bool _isTimer(unsigned long startTime, unsigned long period)
{
unsigned long currentTime;
currentTime = millis();
if (currentTime>= startTime)
{
return (currentTime>=(startTime + period));
}
else
{
return (currentTime >=(4294967295-startTime+period));
}
}Loading
esp32-c3-devkitm-1
esp32-c3-devkitm-1