 
 #include <Arduino.h>
 #include <SPI.h> //required by the library
+#include <TimerOne.h>
 #include <MergCBUS.h>
 #include <Message.h>
 #include <EEPROM.h> //required by the library
-#include <VarSpeedServo.h>
 
 
 //Module definitions

   }
}
//check if we have to togle the event
//based on the node variables
bool togleSensor(int sensor){
  byte first,second;
  bool resp=false;

This example implements a ir sensor controller to detect block occupancy.
It drives 16 ir. Can be more in arduino Mega, but it just an example.
The module produces ON/OFF events.
The vents can be toogled by the first 2 node variables. 0 means ON when train enters, OFF when trains leaves.
1 means the oposit. Each bit of the 2 bytes are to ser togle or not.
Usim FLIM mode teach on/off events.
It implements all automatic configuration, including learning events.
It does not handle DCC messages, but you can do it on your user function.
