       }
   }
   if (lighton==YELLOW){
-    if ((millis()-starttime)>TRANSITION_TIME){
+    byte interval=cbus.getNodeVar(1);
+    if (interval<=0){
+        interval=1;
+    }
+    if ((millis()-starttime)>(TRANSITION_TIME*interval)){
       lighton=nextlighton;
     }
   }


#include <Arduino.h>
#include <SPI.h>
#include <TimerOne.h>
#include <MergCBUS.h>
#include <Message.h>
#include <EEPROM.h>

#define GREEN_LED 5       //merg green led port
#define YELLOW_LED 4      //merg yellow led port
#define PUSH_BUTTON 3     //std merg push button
#define PUSH_BUTTON1 9    //debug push button
//semaphore leds
#define GREEN 10        //green led
#define YELLOW 11        //green led
#define RED 12        //green led
#define TRANSITION_TIME  2000 //time in milli to keep the yellow light on

MergCBUS cbus=MergCBUS(5,20,1,0);
byte lighton;//control the state
byte nextlighton;//control the state
unsigned long starttime;

//timer function to read the can messages
void readCanMessages(){
  //read the can message and put then in a circular buffer
  cbus.cbusRead();
}

void setup(){




  //Configuration data for the node
  cbus.getNodeId()->setNodeName("SEMAPHOR",8);         //node name
  cbus.getNodeId()->setModuleId(MODULE_ID);            //module number
  cbus.getNodeId()->setManufacturerId(MANUFACTURER_ID);//merg code
  cbus.getNodeId()->setMinCodeVersion(MIN_CODE);       //Version 1
  cbus.getNodeId()->setMaxCodeVersion(MAX_CODE);
  cbus.getNodeId()->setProducerNode(false);
  cbus.getNodeId()->setConsumerNode(true);
  cbus.setPushButton(PUSH_BUTTON);//set the push button ports

  //used to manually reset the node. while turning on keep the button pressed
  //this forces the node for slim mode with an empty memory for learned events and devices
  if (digitalRead(PUSH_BUTTON)==LOW){
    Serial.println("Setup new memory");
    cbus.setUpNewMemory();
    cbus.saveNodeFlags();
    //set the default value
    cbus.setNodeVariable(1,NNVar1);
  }

  cbus.setLeds(GREEN_LED,YELLOW_LED);//set the led ports

  cbus.setUserHandlerFunction(&myUserFunc);//function that implements the node logic
  cbus.initCanBus(CANPORT);  //initiate the transport layer

  Serial.println("Setup finished");
}

void loop (){
  cbus.cbusRead();
  cbus.run();//do all logic
}

void myUserFunc(Message *msg,MergCBUS *mcbus){
