0

MRMS_ESP.ino sketch

About the sketch

This program is the best basis to start making Your own more complex Arduino programs using CAN Bus. You will get all the major problems solved: automatic setup of CAN Bus devices, background messaging, program structure, etc. Code is object-oriented. You can make Your specific robot by deriving base Robot class.

Installation

Go to github.com/PribaNosati/MRMS-Arduino-Sketches and download the content in which You will find MRMS_ESP32.ino sketch. Open the ZIP, choose MRMS_ESP32 directory, and copy it to Your Arduino program directory in Windows Explorer (Quick access > Documents > Arduino).

Starting program

Enter the pasted directory and double-click the single file, MRMS_ESP.ino. As Arduino is linked to .ino extension, the Arduino should open.

Switch the robots power on, connect USB cable between MRMS ESP32: Arduino, IMU, eFuse, BT, WiFi, CAN Bus (mrm-esp32) and Your PC. Check that You selected the right board in Arduino IDE and the right port. Click on upload button to upload the sketch into the robot. If Your PC complains that the USB port is busy, reconnect USB cable. The sketch will be uploaded and started.

Click on monitor in Arduino IDE:

.

Choose "No line ending" and 115200 baud rate:

If You do not choose 115200, which matches baud rate in Arduino program, You will get garbage instead of displayed text.

Menu is displayed, containing 3-letter commands' shortcuts, followed by explanations. If You paired a mobile phone with ESP32, You will get the same in Your mobile's terminal application. In Arduino monitor type a command in input field left to "Send" button and hit the button. Watch the command being executed.

A few useful commands:

  • can - lists all the connected CAN Bus devices.
  • idc - changes addresses.
  • loo - starts your custom function.
Type "x" to end commands which run continually. Commands starting with "Test" test particular devices, of course.