#include < mcp_can.h >
#include < elmduino.h >
// Specifies the chip select pin for the MCP2515 (SPI interface)
#define CAN0_CS_PIN 10
// Setup MCP2515 controller
MCP_CAN CAN0(CAN0_CS_PIN);
// Setup ELM327 myELM327. You could also use ELM327 myELM327(&Serial1)
ELM327 myELM327;
uint16_t rpm = 0;
void setup()
{
Serial.begin(115200);
pinMode(CAN0_CS_PIN, OUTPUT);
// Initialize MCP2515 running at 16MHz with a baudrate of 500kb/s and the masks and filters disabled.
if (CAN0.begin(CAN_500KBPS, MCP_16MHZ) == CAN_OK)
Serial.println("MCP2515 Initialized Successfully!");