Arduino and Teensy libraries: Difference between revisions

From Rsewiki
Line 75: Line 75:
  arduino-cli core update-index
  arduino-cli core update-index


=== Teensy 4.1 board ===
=== Teensy support ===


Find the install name of the board type to install
Find the install name of the board type to install

Revision as of 08:32, 22 December 2024

Back to Basebot

Installation of Arduino and Teensy support

This is probably not needed if you intend to use MS Visual Studio.

Arduino (version 2.xx)

Add Teensy board support


"Arduino preferences with additional board manager URL"


  • In the boards manager (Tools->Boards->Boards manager), search for Teensy and install support for Teensy boards.

Add libraries

  • In the Library manager (Tools->Manage libraries), search for "MPU9250_asukiaaa" and "Adafruit GFX library" and install both, including dependencies. These are used to interface the IMU and support for the small display.

Board select

Select the Teensy 4.1 board (tool->board->Teensy->4.1).

Select the port the robot is connected to - it is easier to connect it first.

Arduino command line interface

See https://docs.arduino.cc/arduino-cli/

Install Arduino CLI

Get the install script and let it install arduino-cli into the directory ~/bin. It will detect the download platform and install an appropriate version.

cd
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
cd bin
pwd

Add this directory to the PATH.

nano ~/.bashrc

Add at the end (assuming your login name is local)

export PATH=$PATH:/home/local/bin

Add Teensy support

Make a configuration file (in a hidden file called ~/.arduino15/arduino-cli.yaml).

arduino-cli config init

Copy the URL for Teensyduino https://www.pjrc.com/teensy/package_teensy_index.json and add it to the configuration file.

nano ~/.arduino15/arduino-cli.yaml

Make it look like this:

board_manager:
   additional_urls: ["https://www.pjrc.com/teensy/package_teensy_index.json"]

After this, update the index

arduino-cli core update-index

Teensy support

Find the install name of the board type to install

$ arduino-cli core search teensy
ID         Version Name
teensy:avr 1.59.0  Teensy (for Arduino IDE 2.0.4 or later)

Then, install and configure the Teensy support

arduino-cli core install teensy:avr

Install libraries

Robobot need (especially) these libraries.

  • Adafruit GFX Library
  • MPU9250_asukiaaa

If the exact name is not known, then search, e.g.:

arduino-cli lib search name:"Adafruit GFX Library"

Install

arduino-cli lib install "Adafruit GFX Library"
arduino-cli lib install "MPU9250_asukiaaa"