And please give me a pull request at github when you use a new rate, so I can add it to the library to help other guys. The available baud rates are listed as follows:Ĭase ( CAN_xxxKBPS ) : cfg1 = MCP_16MHz_xxxkBPS_CFG1 cfg2 = MCP_16MHz_xxxkBPS_CFG2 cfg3 = MCP_16MHz_xxxkBPS_CFG3 break This function is used to initialize the baud rate of the CAN Bus system.
Arduino obd2 reader serial#
Open the Serial Monitor of Arduino IDE( slaver), you will get the data sent from the master. #include #include "mcp2515_can.h" /*SAMD core*/ #ifdef ARDUINO_SAMD_VARIANT_COMPLIANCE #define SERIAL SerialUSB #else #define SERIAL Serial #endif const int SPI_CS_PIN = 9 mcp2515_can CAN ( SPI_CS_PIN ) // Set CS pin void setup ()
![arduino obd2 reader arduino obd2 reader](https://cdn.instructables.com/ORIG/FCG/QZ2R/I12KG0SE/FCGQZ2RI12KG0SE.jpg)
Standard ( 11 bit) and extended ( 29 bit) data and remote frames.
![arduino obd2 reader arduino obd2 reader](https://microcontrollerelectronics.com/wp-content/uploads/2014/08/obd-300x300.jpg)
![arduino obd2 reader arduino obd2 reader](https://i.pinimg.com/originals/4b/dc/8d/4bdc8da40a07bd37d7bd07f8f84fb7c8.jpg)
CAN-BUS is a common industrial bus because of its long travel distance, medium communication speed and high reliability.