Hi everyone

Ardiuno Compatible shields

Moderators: lily.li, violet

Post Reply
pascal.clement.ch
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Tue Oct 23, 2018 2:38 pm

Hi everyone

Post by pascal.clement.ch » Tue Feb 12, 2019 6:19 pm

I tried to read the can buf during the interrupt like:

Code: Select all

void MCP2515_ISR() {
  while (CAN_MSGAVAIL == CAN.checkReceive()) {
    CAN.readMsgBuf(&len, buf);

    for (int i = 0; i < len; i++) {
      Serial.print(buf[i]); Serial.print("\t");
    }
    
    Serial.println();
  }
}

void loop() {

}
but I get no data. Is there a reason way I can not read the buffer like this?

User avatar
bestlux
Kindergarten
Kindergarten
Posts: 85
Joined: Wed Jan 30, 2019 11:51 am

Re: Hi everyone

Post by bestlux » Mon Feb 18, 2019 3:21 pm

Hello, I have not seen you have set up any interruption in the code you posted. Are you sure you have posted complete code?

Post Reply