ZUNO_START_CONFIG()

This function instructs Z-Uno to start channels and association configuration. Use it to configure your Z-Uno right from the user code. After changing the number or types of channels or association groups Z-Uno must be excluded and included back. Z-Uno will not adopt any channel type change without being excluded. (A debug configuration parameter can disable this restriction). ZUNO_START_CONFIG() Z-Uno dynamic configuration uses the following functions:
  • ZUNO_START_CONFIG(),
  • ZUNO_ADD_CHANNEL(),
  • ZUNO_ADD_ASSOCIATION(),
  • ZUNO_COMMIT_CONFIG(),
  • ZUNO_GET_CONFIG_STATE(),
Good examples of usage of dynamic configuration can be found in Modem example or multiple DS18B20 temperature sensors. Below is the Radio Blink sketch from Z-Uno paper manual made in static style

byte dimmerValue=0xFF;

ZUNO_SETUP_CHANNELS(ZUNO_SWITCH_MULTILEVEL(getSwitchMultilevelValue, setSwitchMultilevelValue));

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  dimmerValue = 100;
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(dimmerValue*10);
  digitalWrite(LED_BUILTIN, LOW);
  delay(dimmerValue*10);
}

void setSwitchMultilevelValue(byte newValue) {
  dimmerValue = newValue;
}

byte getSwitchMultilevelValue(void) {
  return dimmerValue;
}
Below is the Radio Blink sketch from Z-Uno paper manual made in dynamic style

byte dimmerValue=0xFF;

void setup() {
  ZUNO_START_CONFIG();
  ZUNO_ADD_CHANNEL(ZUNO_SWITCH_MULTILEVEL_CHANNEL_NUMBER, 0, 0);
  ZUNO_COMMIT_CONFIG();

  pinMode(LED_BUILTIN, OUTPUT);
  dimmerValue = 100;
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(dimmerValue*10);
  digitalWrite(LED_BUILTIN, LOW);
  delay(dimmerValue*10);
}

void setSwitchMultilevelValue(byte newValue) {
  dimmerValue = newValue;
}

byte getSwitchMultilevelValue(void) {
  return dimmerValue;
}

void zunoCallback(void) {
    switch(callback_data->type) {
       case  ZUNO_CHANNEL1_GETTER:
          callback_data->param.bParam = getSwitchMultilevelValue();
          break;
       case  ZUNO_CHANNEL1_SETTER:
          setSwitchMultilevelValue(callback_data->param.bParam);
          break;

        default:
          break;
    }
}