mirror of
https://github.com/Seeed-Studio/Seeed_Arduino_CAN.git
synced 2026-07-28 04:06:45 +00:00
More recomended way to use attachInterrupt
This commit is contained in:
committed by
Baozhu Zuo
parent
1935258e58
commit
7d41ceb28a
@@ -19,7 +19,7 @@ const int SPI_CS_PIN = 9;
|
||||
|
||||
MCP_CAN CAN(SPI_CS_PIN); // Set CS pin
|
||||
|
||||
|
||||
const byte interruptPin = 0;
|
||||
unsigned char flagRecv = 0;
|
||||
unsigned char len = 0;
|
||||
unsigned char buf[8];
|
||||
@@ -37,7 +37,7 @@ void setup()
|
||||
}
|
||||
SERIAL.println("CAN BUS Shield init ok!");
|
||||
|
||||
attachInterrupt(0, MCP2515_ISR, FALLING); // start interrupt
|
||||
attachInterrupt(digitalPinToInterrupt(interruptPin), MCP2515_ISR, FALLING); // start interrupt
|
||||
|
||||
|
||||
/*
|
||||
@@ -89,4 +89,4 @@ void loop()
|
||||
|
||||
/*********************************************************************************************************
|
||||
END FILE
|
||||
*********************************************************************************************************/
|
||||
*********************************************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user