Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Schedule display
#17
Hi, 
you can send unlimited schedules.

You have to make some additions to the arduino code like the code below

Code:
//---- Enter all the Tags here. You have to use the same Tags on Virtuino variables
  const char* pin0_tag= "schedule";         // tag for digital input
  String scheduleHolder="";
  unsigned long lastMillis = 0;

  String char* pin1_tag = "schedule2";
  String scheduleHolder2="";

//===================================================== sendPinStatus
void sendPinsStatus(){
  sendValue(pin0_tag,scheduleHolder);    // if you want send the schedule to VirtuinoIoT when the board is
  sendValue(pin1_tag,scheduleHolder2);
connected
  // add more here...
  }

//===================================================== onValueReceived
  void onValueReceived(String tag, String value){
    Serial.println("Received: tag="+tag+ "  value="+value);
 
    if (tag== pin0_tag) {                   
      Serial.println("Schedule received");
      scheduleHolder = value;
    }
    else if (tag== pin1_tag){
      Serial.println("Schedule2 received");
      scheduleHolder2= value;
    }
    }


// call the getscheduleState with the String parameter"mySchedule"

boolean getscheduleState(byte clockDoW, byte clockHour, byte clockMinute, byte clockSecond, String mySchedule){
  boolean returnedState=false;
  JSONVar myObject = JSON.parse(mySchedule);
//........

}


On Virtuino IoT app use a Variable with the tag "schedule" to store the second schedule
Reply


Messages In This Thread
Schedule display - by marcopc - 07-11-2023, 02:25 PM
RE: Schedule display - by iliaslamprou - 07-11-2023, 10:36 PM
RE: Schedule display - by marcopc - 07-12-2023, 07:01 AM
RE: Schedule display - by iliaslamprou - 07-15-2023, 07:39 PM
RE: Schedule display - by marcopc - 07-18-2023, 06:43 AM
RE: Schedule display - by marcopc - 07-21-2023, 11:58 AM
RE: Schedule display - by iliaslamprou - 07-25-2023, 01:43 AM
RE: Schedule display - by marcopc - 07-28-2023, 06:25 AM
RE: Schedule display - by iliaslamprou - 07-29-2023, 01:58 AM
RE: Schedule display - by marcopc - 07-29-2023, 08:02 AM
RE: Schedule display - by iliaslamprou - 07-29-2023, 07:38 PM
RE: Schedule display - by marcopc - 08-02-2023, 09:34 AM
RE: Schedule display - by marcopc - 08-04-2023, 07:03 AM
RE: Schedule display - by iliaslamprou - 08-04-2023, 06:42 PM
RE: Schedule display - by marcopc - 08-05-2023, 07:06 AM
RE: Schedule display - by marcopc - 08-05-2023, 03:40 PM
RE: Schedule display - by iliaslamprou - 08-05-2023, 09:25 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)