Exploring CAN Protocol

Did you look at the example that comes with the library?

The example from the Seeed Can library is a bit easier to understand:

You have to set the masks (there are 2) and then use the filters to only get the IDs that you want to receive

void setup() {
  ...

        //set mask, set both the mask to 0x3ff
    CAN.init_Mask(0, 0, 0x3ff);
    CAN.init_Mask(1, 0, 0x3ff);


    /*
        set filter, we can receive id from 0x04 and 0x05, there are 6 filters

    */
    CAN.init_Filt(0, 0, 0x04);
    CAN.init_Filt(1, 0, 0x05);

...
}


1 Like