CAN (canbus)

begin()

CAN::begin, begin, CAN.begin

Joins the bus at the given baud rate.

// SYNTAX
can.begin(baud, flags);

Parameters:

  • baud: common baud rates are 50000, 100000, 125000, 250000, 500000, 1000000
  • flags (optional): CAN_TEST_MODE to run the CAN bus in test mode where every transmitted message will be received back
// EXAMPLE
CANChannel can(CAN_D1_D2);
can.begin(500000);
// Use for testing without a CAN transceiver
can.begin(500000, CAN_TEST_MODE);