Skip to content

Commit 1c6d5df

Browse files
authored
Merge pull request sandeepmistry#5 from sandeepmistry/arduino-mkr-can-shield
Add default pins for Arduino MKR CAN shield
2 parents b2a4791 + c8e96a6 commit 1c6d5df

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ env:
44
- IDE_VERSION=1.8.5
55
matrix:
66
- BOARD="arduino:avr:uno"
7+
- BOARD="arduino:samd:mkrzero"
78
- BOARD="espressif:esp32:esp32"
89
before_install:
910
- wget http://downloads.arduino.cc/arduino-$IDE_VERSION-linux64.tar.xz
1011
- tar xf arduino-$IDE_VERSION-linux64.tar.xz
1112
- mv arduino-$IDE_VERSION $HOME/arduino-ide
1213
- export PATH=$PATH:$HOME/arduino-ide
14+
- if [[ "$BOARD" =~ "arduino:samd:" ]]; then
15+
arduino --install-boards arduino:samd;
16+
fi
1317
- if [[ "$BOARD" =~ "espressif:esp32:" ]]; then
1418
mkdir -p $HOME/Arduino/hardware/espressif;
1519
git clone https://github.com/espressif/arduino-esp32.git $HOME/Arduino/hardware/espressif/esp32;

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ An Arduino library for sending and receiving data using CAN bus.
77
## Compatible Hardware
88

99
* [Microchip MCP2515](http://www.microchip.com/wwwproducts/en/en010406) based boards/shields
10+
* [Arduino MKR CAN shield](https://store.arduino.cc/arduino-mkr-can-shield)
1011
* [Espressif ESP32](http://espressif.com/en/products/hardware/esp32/overview)'s built-in [SJA1000](https://www.nxp.com/products/analog/interfaces/in-vehicle-network/can-transceiver-and-controllers/stand-alone-can-controller:SJA1000T) compatible CAN controller with an external 3.3V CAN transceiver
1112

1213
### Microchip MCP2515 wiring

src/MCP2515.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,15 @@
1111
#include "CANController.h"
1212

1313
#define MCP2515_DEFAULT_CLOCK_FREQUENCY 16e6
14+
15+
#if defined(ARDUINO_ARCH_SAMD) && defined(USB_VID) && (USB_VID == 0x2341) && !defined(ARDUINO_SAMD_ZERO)
16+
// Arduino MKR board: MKR CAN shield CS is pin 3, INT is pin 7
17+
#define MCP2515_DEFAULT_CS_PIN 3
18+
#define MCP2515_DEFAULT_INT_PIN 7
19+
#else
1420
#define MCP2515_DEFAULT_CS_PIN 10
1521
#define MCP2515_DEFAULT_INT_PIN 2
22+
#endif
1623

1724
class MCP2515Class : public CANControllerClass {
1825

0 commit comments

Comments
 (0)