Prepare for compile: Difference between revisions

From Rsewiki
Line 3: Line 3:
== Development environment (IDE) ==
== Development environment (IDE) ==


=== Arduino ===
The Basebot code can be maintained in either Arduino IDE, by Microsoft Visual Studio Code, or from the command line (using any editor).
 
== Arduino ==


Install Arduino support; see [[Arduino and Teensy libraries]]
Install Arduino support; see [[Arduino and Teensy libraries]]
Line 22: Line 24:


The '''basebot''' will send data to the serial monitor. This data needs to be stored in a file for Matlab use, and another serial monitor or other tool probably has to be used.  
The '''basebot''' will send data to the serial monitor. This data needs to be stored in a file for Matlab use, and another serial monitor or other tool probably has to be used.  
== Visual Studio Code ==


=== Visual studio code (Linux) ===
=== Visual studio code (Linux) ===
Line 51: Line 55:
Then, PlatformIO will install dependencies and check the project. If there is an error, read the error text and try to fix it.
Then, PlatformIO will install dependencies and check the project. If there is an error, read the error text and try to fix it.


=== Command line compile and upload ===
== Command line compile and upload ==
 
This is a possibility when running Linux.


This is a possibility when running Linux
Refer to the command-line installation instructions for Arduino.


See the command line installation for Arduino
There are two files in the project for compiling (compile) and uploading (upload); these assume that the command-line tools are installed.

Revision as of 07:56, 30 August 2025

Back to Basebot

Development environment (IDE)

The Basebot code can be maintained in either Arduino IDE, by Microsoft Visual Studio Code, or from the command line (using any editor).

Arduino

Install Arduino support; see Arduino and Teensy libraries

Open Arduino and select the basebot_6.ino.

Then, set the board to Teensy 4.1.

You should now be able to compile and upload the code to the robot.

Note

Editing the basebot files in the src subdirectory can not be done in the Arduino IDE, but maybe that is unnecessary.

The basebot will send data to the serial monitor. This data needs to be stored in a file for Matlab use, and another serial monitor or other tool probably has to be used.

Visual Studio Code

Visual studio code (Linux)

Install MS Visual Studio; see Visual studio install

Create a directory called src that links to the basebot_6 directory. In a terminal in the working directory where you installed the code:

cd basebot
ln -s basebot_6 src

This step is needed, as MS Visual Studio Code need this directory for the actual code.

Visual studio code (Windows)

Install MS Visual Studio; see Visual studio install

Rename the basebot_6 directory to src, as this is mandatory for MS Visual studio code.

Open the code using the PlatformIO icon :

PlatformIO -> "QUICK ACCESS" -> "PIO Home" -> "Open" and here press "Open Project"

Find the Basebot directory - it holds the platformio.ini file needed to configure the project (i.e. Teensy 4.1, and the libraries needed).

Then, PlatformIO will install dependencies and check the project. If there is an error, read the error text and try to fix it.

Command line compile and upload

This is a possibility when running Linux.

Refer to the command-line installation instructions for Arduino.

There are two files in the project for compiling (compile) and uploading (upload); these assume that the command-line tools are installed.