Page 008 Arduino CBUS Libraries Available - johnmholmes/Arduino-CBUS--Introduction-Series GitHub Wiki
Page updated 9/10/2024
Introduction
To move forward with this project I decided to investigate some ready made library examples, which can be found in the Arduino IDE library manager. My experience with the Arduino mcp_can library. I now felt I was ready to look at these example sketches.
CBUS2515 library
This library by Duncan Greenwood is being used by a number of more experienced programmers within MERG.
- The library Documentation can be found in this repository under CBUS2515 documentation.
- If you take a look at this short video it shows the setup required to get them.
- The library at the start of my journey was at 1.1.19.
- This may get a update in the near future to amend some minor issues.
There are 3 examples that are available.
- Cbus_1in1out
- CBUS_empty
- CBUS_long_message_example
- You will also need 2 other 3rd party libraries to be able to follow along with the examples. ACAN2515 and Streaming
Conclusion
I did try the 1in1out example. My lack of understand how this library worked and the use of the MERG FCU meant, I had a few issues which was a bit off putting at first. Which made me take a break from this project for a short time to reflect on it. After the break I found Martin's version of this sketch which had more documentation which was the icing on the cake for me.
- The main issue I struggled to get my head around was the library CBUSswitch / CBUSSwitch, at first because when I tried to compile it on a Windows based machine it would fail to compile. This issue has been resolved in the library is CBUSswitch, but the folder it is in is labelled CBUSSwitch on a Windows machine I am not sure what other operating systems label the folder as. (In the CBUS2515 Library the fix is in the library properties file, the depends is set to CBUSSwitch.)
- The next issue I had was learning how to use the MERG FCU with these modules. This was resolved with the help of Sven another MERG member who gave the solution. Duncan uses JMRI to do his module configurations as he uses a MAC PC.
MergCBUS library
I have also had an experiment with this library initially for servo control. for more details see the page What Next Servos