#include <stdio.h>
#include "pico/stdlib.h"
#include "can_mcp2515.h"

struct can_frame rx;

int main() {
    stdio_init_all();

    //Initialize interface
    MCP2515_reset();
    MCP2515_setBitrate(CAN_1000KBPS, MCP_16MHZ);
    MCP2515_setNormalMode();

    //Listen loop
    while(true) {
        if(MCP2515_readMessage(&rx) == MCP2515_ERROR_OK) {
            printf("New frame from ID: %10x\n", rx.can_id);
        }
    }

    return 0;
}
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT