Skip to content

Commit ee9eb09

Browse files
authored
Merge pull request #3 from PhirePhly/master
Unify data type for time variables
2 parents 18eee39 + bdb1c6d commit ee9eb09

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/ESP8266/ChannelStatistics/ChannelStatistics.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ char password[] = "yyyy"; // your network key
2323
WiFiClientSecure client;
2424
YoutubeApi api(API_KEY, client);
2525

26-
int api_mtbs = 60000; //mean time between api requests
27-
long api_lasttime; //last time api request has been done
26+
unsigned long api_mtbs = 60000; //mean time between api requests
27+
unsigned long api_lasttime; //last time api request has been done
2828

2929
long subs = 0;
3030

@@ -57,7 +57,7 @@ void setup() {
5757

5858
void loop() {
5959

60-
if (millis() > api_lasttime + api_mtbs) {
60+
if (millis() - api_lasttime > api_mtbs) {
6161
if(api.getChannelStatistics(CHANNEL_ID))
6262
{
6363
Serial.println("---------Stats---------");

0 commit comments

Comments
 (0)