-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the ability to have multiple classes register as listeners.
Updated the example sketch to show the new, slightly different syntax. Currently the limit is four listeners. Also, the begin() set of functions will only really initialize the bus if it wasn't already. It will no longer allow you to change the baud rate of an already initialized bus. For that use set_baudrate.
- Loading branch information
Showing
3 changed files
with
141 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
070851c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for posting this question here. It's not related to the commit at all, but I couldn't come up with a better idea of how to contact you.
I downloaded this library and tried to run the examples on my Arduino Due board. It failed, probably because I connected the pins wrong. Could you please explain how to connect the pins to transmit data between can0 and can1? I connected can0 tx to can1 rx and vice versa. Is a tranceiver needed?
070851c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you need transceivers. People sometimes try to cheat and not use them. If you insist on trying you might be able to use google to figure it out but it isn't a good idea. Instead, you need two transceivers - one for CAN0 and one for CAN1. Then you connect CAN0 Low to CAN1 Low and CAN0 High to CAN1 High.
070851c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay thanks. I ordered 3.3V tranceivers a few days ago and I'll give it another try when they have arrived.
I have colleagues that use CAN quite frequently, and one of them said that it works to connect two can controllers without tranceivers, just as I tried. I guess he was wrong, or that something else affected the result.
Thanks for the quick reply!
070851c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For quick test purposes with very short cable lengths, you can get away with a few diodes and a pull-up resistor. http://www.mikrocontroller.net/attachment/28831/siemens_AP2921.pdf
But like Colin said, it is not the proper way to do it. Might be fun to try out while you are waiting for your transceivers though. :)
070851c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohhh I can't wait to test this :P
Since the arduino due runs ön 3.3V I'll add a pullup to that voltage instead of 5V as the document said.
Thanks.