The easiest way to get started with Carloop is to use the demo program included in the library.
The demo program will print the battery voltage, number of CAN messages and GPS position to the USB serial port.
To use it connect a Particle Photon or Particle Electron into your Carloop. Then go to the Particle Build online code editor. Go to the library section (bookmark icon), search for Carloop and click "Use this example".
The demo program is made with the carloop-library
Maybe it is easier if we add some screenshots to go along with it.
Step 1: Create a new Particle App
Step 2: Add the Carloop library to your app
Step 3: Click on Include in App
Step 4: You are done!
I got these errors.
carloop/carloop.h:20:38: error: 'CAN_D1_D2' was not declared in this scope static constexpr auto CAN_PINS = CAN_D1_D2;
carloop/carloop.h:51:5: error: 'CANChannel' does not name a type CANChannel &can();
carloop/carloop.h:68:5: error: 'CANChannel' does not name a type CANChannel canDriver;
It looks like you might be using an older version of Particle's firmware. Try changing your target device's firmware to version 0.4.9 or later to be able to use CAN. In order to do so:
Click on the Devices icon:
Click on your device (Electron or Photon) and select 0.4.9 or later in the dropdown:
Thank you, I was on 0.4.8
Great to hear. I'll also add that to the 'Getting Started with Carloop' topic.