Added pull request: https://github.com/sandeepmistry/arduino-CAN/pull/27/commits/47c36a5b624c412cb620c9fe1177e79fef756999
All credit to github user Deltaphi
An Arduino library for sending and receiving data using CAN bus.
- Microchip MCP2515 based boards/shields
- Espressif ESP32's built-in SJA1000 compatible CAN controller with an external 3.3V CAN transceiver
| Microchip MCP2515 | Arduino |
|---|---|
| VCC | 5V |
| GND | GND |
| SCK | SCK |
| SO | MISO |
| SI | MOSI |
| CS | 10 |
| INT | 2 |
CS and INT pins can be changed by using CAN.setPins(cs, irq). INT pin is optional, it is only needed for receive callback mode. If INT pin is used, it must be interrupt capable via attachInterrupt(...).
NOTE: Logic level converters must be used for boards which operate at 3.3V.
Requires an external 3.3V CAN transceiver, such as a TI SN65HVD230.
| CAN transceiver | ESP32 |
|---|---|
| 3V3 | 3V3 |
| GND | GND |
| CTX | GPIO_5 |
| CRX | GPIO_4 |
CTX and CRX pins can be changed by using CAN.setPins(rx, tx).
- Choose
Sketch->Include Library->Manage Libraries... - Type
CANinto the search box. - Click the row to select the library.
- Click the
Installbutton to install the library.
cd ~/Arduino/libraries/
git clone [email protected]:JakeDimes/arduino-CAN.git CANSee API.md.
See examples folder.
For OBD-II examples, checkout the arduino-OBD2 library's examples.
This library is licensed under the MIT Licence.