Schedular widget not working in iot cloud in any Time Zone for me

Hello,

I am using scheduler widget in my Arduino cloud project but its not working. the code which I supplied is very simple which turn the servo certain degrees at certain time for a couple of minutes.

The Time zone which I have chose is "Asia/Karachi". its not working with that. Then after reading a couple of more articles it says the default time for cloud is UTC which i also supplied to it but no response from the scheduler.

I tried it with different repeat modes but still no good (both with my current time zone an UTC).

Code:

/* 
  Sketch generated by the Arduino IoT Cloud Thing "Untitled"
  https://create.arduino.cc/cloud/things/7a2f6062-15f2-4350-aae9-7f9a79a8c6e6 

  Arduino IoT Cloud Variables description

  The following variables are automatically generated and updated when changes are made to the Thing

  int servo;
  CloudSchedule schedule1;

  Variables which are marked as READ/WRITE in the Cloud Thing will also have functions
  which are called when their values are changed from the Dashboard.
  These functions are generated with the Thing and added at the end of this sketch.
*/

#include "thingProperties.h"
#include <Servo.h>

Servo servo1;

void setup() {
  
  Serial.begin(115200);
  delay(1500); 
  servo1.attach(D1);
  servo1.write(0);
  
  initProperties();

  ArduinoCloud.begin(ArduinoIoTPreferredConnection);
  
  setDebugMessageLevel(2);
  ArduinoCloud.printDebugInfo();
}

void loop() {
  ArduinoCloud.update();
  
  // Your code here
  
  if(schedule1.isActive())
  {
    servo1.write(90);
  }
  else
  {
    servo1.write(180);
  }
}
1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.