Smart Poi 3.0.0
WiFi Connected LED POV Poi
Loading...
Searching...
No Matches
timeFunc.ino File Reference

Functions

void ChangePatternPeriodically ()
 Changes the pattern periodically based on the set interval.
 

Function Documentation

◆ ChangePatternPeriodically()

void ChangePatternPeriodically ( )

Changes the pattern periodically based on the set interval.

Checks the current time against the previous pattern change time to determine if the interval has passed. If the interval has passed, increments the pattern index and updates the previous pattern change time. If the pattern index exceeds the maximum allowed value, resets it to the minimum allowed value.

Note
This function is intended to be called repeatedly to ensure timely pattern changes.
The interval is set using the /intervalChange route.
16{
17 unsigned long currentMillis3 = millis();
18 if (currentMillis3 - previousMillis3 >= interval) //should not ever be true if udp is sending at correct speed!
19 {
20 imageToUse++;
21 previousMillis3 = currentMillis3;
23 {
25 }
26 }
27}
int maxImages
Definition main.ino:174
int minImages
Definition main.ino:175
long interval
Definition main.ino:127
int imageToUse
Definition main.ino:172
unsigned long previousMillis3
Definition main.ino:126

References imageToUse, interval, maxImages, minImages, and previousMillis3.

Referenced by loop().

Here is the caller graph for this function: