3#include <freertos/FreeRTOS.h>
4#include <freertos/task.h>
15 vTaskDelay(pdMS_TO_TICKS(ms));
42 return pdTICKS_TO_MS(xTaskGetTickCount());
51 return float(
millis()) / 1000.f;
70 uint32_t x = esp_random();
71 uint64_t m = uint64_t(x) * uint64_t(max);
72 uint32_t l = uint32_t(m);
82 m = uint64_t(x) * uint64_t(max);
96inline long random(
long min,
long max) {
100 long diff = max - min;
101 return random(diff) + min;
121inline long nahodne(
long minimum,
long maximum) {
122 return random(minimum, maximum);
131void saveInt(
const std::string& name,
int value);
140int loadInt(
const std::string& name,
int defaultVal = 0);
long random(long max)
Get random number from 0 to max.
Definition: ArduinoLikeUtils.hpp:69
void saveInt(const std::string &name, int value)
Saves an integer into the persisent NVS storage.
Definition: ArduinoLikeUtils.cpp:4
void delay(uint32_t ms)
Wait for specified amount of milliseconds.
Definition: ArduinoLikeUtils.hpp:14
long nahodne(long maximum)
Vrátí náhodné číslo od 0 do maximum.
Definition: ArduinoLikeUtils.hpp:110
float vteriny()
Vrátí počet vteřin od začátku programu.
Definition: ArduinoLikeUtils.hpp:59
float seconds()
Returns time since boot in seconds.
Definition: ArduinoLikeUtils.hpp:50
uint32_t millis()
Returns time since boot in milliseconds.
Definition: ArduinoLikeUtils.hpp:41
void cekejVteriny(float vteriny)
Čeká po specifikovaný počet vteřin.
Definition: ArduinoLikeUtils.hpp:32
void waitSeconds(float seconds)
Wait for specified amount of seconds.
Definition: ArduinoLikeUtils.hpp:23
int loadInt(const std::string &name, int defaultVal=0)
Loads an integer from the persistent NVS storage.
Definition: ArduinoLikeUtils.cpp:9