Gast
#4228304
Hello, I have the volvo s80 car 2008, i trying to capture steering wheel button presses, the problem is when i press the two different buttons i receive the same can-bus message, for example: 1. When i press "Exit" button i receive: canId = 0x7A, message = 0x0 9F 80 0 0 0 0 21 0 2. When i press "Enter" button i receive the same message: canId = 0x7A, message = 0x0 9F 80 0 0 0 0 21 0 If i press other buttons(for example "cruise control start" on steering wheel or some button on radio) i receive uniqueness messages and last bytes changes for each other button presses. I'm using arduino and can-bus shield(elecfreaks), maybe somebody can help me and explain what can be wrong, here is my arduino sketch: #include <SPI.h> #include "mcp_can.h" const int SPI_CS_PIN = 10; MCP_CAN CAN(SPI_CS_PIN); // Set CS pin void setup() { Serial.begin(115200); START_INIT: if(CAN_OK == CAN.begin(CAN_125KBPS)) { Serial.println("CAN BUS Shield init ok!"); } else { Serial.println("CAN BUS Shield init fail"); Serial.println("Init CAN BUS Shield again"); delay(100); goto START_INIT; } } void loop() { 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 char canId = CAN.getCanId(); Serial.println("-----------------------------"); Serial.println("get data from ID: "); Serial.println(canId); for(int i = 0; i<len; i++) // print the data { Serial.print(buf[i]); Serial.print("\t"); } Serial.println(); } }