Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not read message .. (extendet) #143

Open
aortner opened this issue May 22, 2023 · 0 comments
Open

Can not read message .. (extendet) #143

aortner opened this issue May 22, 2023 · 0 comments
Labels
Seeed_Arduino_CAN Label for Seeed_Arduino_CAN UAY Unassigned yet

Comments

@aortner
Copy link

aortner commented May 22, 2023

char hole[8] = {0x40, 0x00, 0x21, 0x01, 0x00, 0x00, 0x00, 0x00 };
CAN.MCP_CAN::sendMsgBuf(0x06000001, 1, 8, hole);

i send this to my keya motor..

i should get:
Motor current query: 40 00 21 01 00 00 00 00
Return ID: 0x0580000 + controller ID (hexadecimal)
Data 60 00 21 01 DATA 00 00 00
DATA =((unsigned char*)(&send_float))

but i do not receive anything...

with this:
unsigned char len = 0;
unsigned char buf[8];

if (CAN_MSGAVAIL == CAN.checkReceive()) {         // check if data coming
    CAN.readMsgBuf(&len, buf);    // read data,  len: data length, buf: data buf

    unsigned long canId = CAN.getCanId();

    SERIAL_PORT_MONITOR.println("-----------------------------");
    SERIAL_PORT_MONITOR.print("Get data from ID: 0x");
    SERIAL_PORT_MONITOR.println(canId, HEX);

    for (int i = 0; i < len; i++) { // print the data
        SERIAL_PORT_MONITOR.print(buf[i], HEX);
        SERIAL_PORT_MONITOR.print("\t");
    }
    SERIAL_PORT_MONITOR.println();
@MatthewJeffson MatthewJeffson added UAY Unassigned yet Seeed_Arduino_CAN Label for Seeed_Arduino_CAN labels Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Seeed_Arduino_CAN Label for Seeed_Arduino_CAN UAY Unassigned yet
Projects
Status: No status
Development

No branches or pull requests

2 participants