 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 events 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 set toggle or not.
+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.


#include <Arduino.h>
#include <SPI.h> //required by the library
#include <MergCBUS.h>
#include <Message.h>
#include <EEPROM.h> //required by the library
#include <VarSpeedServo.h>


//Module definitions

//create the merg object
MergCBUS cbus=MergCBUS(NODE_VARS,NODE_EVENTS,EVENTS_VARS,DEVICE_NUMBERS);

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

void setup(){
  
