Arduino and Teensy libraries: Difference between revisions
| Line 113: | Line 113: | ||
usb3/3-2 teensy Teensy Ports Teensy 4.1 teensy:avr:teensy41 teensy:avr | usb3/3-2 teensy Teensy Ports Teensy 4.1 teensy:avr:teensy41 teensy:avr | ||
In this case the key name is ''teensy:avr:teensy41'' | In this case, the key name is "''teensy:avr:teensy41''" | ||
Revision as of 08:42, 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)
- Install the newest Arduino - see https://www.arduino.cc/en/software.
Add Teensy board support
- Add the Teensy hardware support - see https://www.pjrc.com/teensy/td_download.html, including
- Add https://www.pjrc.com/teensy/package_teensy_index.json to the file->preferences
- 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 boards
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
Install 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"
Compile
With the board connected, find the board type name:
$ Arduino-cli board list Port Protocol Type Board Name FQBN Core /dev/ttyACM0 serial Serial Port (USB) Unknown /dev/ttyAMA10 serial Serial Port Unknown usb3/3-2 teensy Teensy Ports Teensy 4.1 teensy:avr:teensy41 teensy:avr
In this case, the key name is "teensy:avr:teensy41"