![]() Would also like to hear from anyone who has connected two arduinos together to talk via the can bus, and whether there are any tricks to observe. Would be grateful if anyone has run a shield with an Arduino (Elecfreaks or other) with no other connection to any other instruments and got a success instead of a fail when running the send routine, or whether i should expect a fail under those circumstances. Thought it might be the termination of the CAN bus so added two 100 ohm resistors (near enough to 120 ohm) to terminate the CAN bus, but still had the same result. I thought it might be that the rate was too high, so changed the rate to CAN_5KBS with the same result. Same message, and when I changed the code on the receive code to check for CAN_OK after calling CAN.begin, found that that failed as well. I loaded the receive code on the other arduino. I thought it might be the fact that nothing was connected on the Can bus, so connected the other arduino connecting the canh, canl and ground terminals. Supports Microchip MCP2515 based boards/shields and the Espressif ESP32's built-in SJA1000 compatible CAN controller. I have run the send code without connecting the arduino to anything and obtained An Arduino library for sending and receiving data using CAN bus. The code is the same as that posted in the first message in this thread. I have loaded the library posted on the Elecfreaks website ( micro:bit Accessories Store | ELECFREAKS) under 'Paintcode' - I think something must have been lost in the translation from Chinese - so I think that I have used the correct library, though I have tried other libraries as well. I think it must be something I am doing wrong, because two shields can't be defective, and i have tried two Unos and a Franziz board from a Tutorial kit. I also thought the shield I was using was defective so i bought another, and have the same problems. I also have an Arduino Uno R3 and a CAN BUS shield from. If this is not theccase the problem is probably in the arduino or driver side. I think that with your code at least can init fail should comes out from the serial monitor. When I try the "receive" code, nothing comes out on the serial monitor, like it's not reading anything. send data: id = 0x00, standrad flame, data len = 8, stmp: data buf If(CAN.begin(CAN_500KBPS) =CAN_OK) Serial.print("can init ok!!\r\n") Įlse Serial.print("Can init fail!!\r\n") The code i'm using to send is this: #include Any suggestions? I've also used a number of different libraries. I've tried the simple examples for send or receive that come with the shield's library to no avail. Also when I connect the car cluster, the Rx led on the shield stays on but nothing else. ![]() But i think the shield I'm using may be defective, since it always fails to initialize can. I did my homework, a lot of work has already been done on the subject and is posted online. Hello, I got an Arduino Uno R3 and a CAN BUS shield from to try and control an instrument cluster from a Mazda RX8.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |