Giter Club home page Giter Club logo

teensy-sidewinder's Introduction

Teensy 3.x/4.x Project Template

A comprehensive Teensy 3.x/4.x project template for Linux, Windows Subsystem for Linux (WSL), and Windows. Inspired by apmorton/teensy-template referencing the Teensy cores from PaulStoffregen/cores. Configurations for VS Code are included, but not required to use this project template.

Tools Setup

After cloning this project you'll need the appropriate tools for your OS to compile and upload your code to your Teensy. You have two options (for WSL you must install Teensyduino for Windows from option 2 regardless of which tools option you choose):

Option 1. Subtree the Standalone Teensy Tools from this Repository

Enables your project to compile standalone, but increases your project size. Run these two Git commands from the terminal within your project:

  1. git remote add tools https://github.com/rspurrell/teensy-template.git
  2. Then either:
    • Linux/WSL: git subtree add --squash --prefix=tools/ tools linux-tools
    • Windows: git subtree add --squash --prefix=tools/ tools windows-tools

Option 2. Install Arduino and Teensyduino

Consumes a smaller footprint, but has a dependency on having Teensyduino installed to compile.

Linux/WSL

  1. Download and extract an Arduino IDE tarball:
wget https://downloads.arduino.cc/arduino-1.8.13-linux64.tar.xz
tar xvf arduino-1.8.13-linux64.tar.xz -C /path/to/parent
  1. Download and install Teensyduino:
wget https://www.pjrc.com/teensy/td_153/TeensyduinoInstall.linux64
chmod 755 TeensyduinoInstall.linux64
./TeensyduinoInstall.linux64 --dir=/path/to/parent/arduino-1.8.13

WSL/Windows

  1. Install the Arduino IDE
  2. Install Teensyduino for Windows

Environment Setup

Linux

  1. Install the Teensy udev rule: sudo cp 49-teensy.rules /etc/udev/rules.d/
  2. Unplug your Teensy and plug it back in

WSL

Create a convenient shortcut to the Teensy loader executable at %PROGRAMFILES(x86)%\Arduino\hardware\tools\teensy.exe.

Please note that since there is no USB support in WSL, make upload will not work.

Windows

Install GNU Make for Windows. I highly recommended using the Windows package manager, Chocolately. Once installed, simply type choco install make on an elevated command line.

Using the Template

  1. Put your code in src/main.cpp and its folder
  2. Put any libraries you need in libraries
  3. Set the TEENSY variable in Makefile according to your teensy version
    • You may need to update the TOOLSPATH variable depending what you choose for your tools setup
  4. Build your code make. Alternatively, use make TEENSY=** where ** is your Teensy version [LC, 30, 31, 32, 35, 36, 40, 41]
  5. Upload your code:
    • Linux/Windows: make upload (does not work with WSL)
    • WSL: Using Teensy loader, locate and load the compiled hex file located in your WSL project folder. (eg. \\wsl$\Ubuntu-20.04\home\rspurrell\workspaces\teensy\teensy-template\bin)

Using VS Code

  1. Install the Microsoft C/C++ Extensions
  2. Open this project folder in VS Code
  3. Adjust the toolsPath and compilerPath in .vscode/c_cpp_properties.json as necessary
  4. Select the configuration matching your Teensy. Ctrl+Shift+P and type Select a Configuration

References

  • The cores sub-folder is a git subtree of PaulStoffregen/cores
  • The linux-tool and windows-tools branches are taken from Teensyduino v1.5.3
  • The src/main.cpp file is a copy of teensy4/main.cpp
  • The Makefile file is a modified copy of teensy3/Makefile
  • The 49-teensy.rules file is taken from PJRC's udev rules
  • Inspiration for this template was appropriated from apmorton/teensy-template

teensy-sidewinder's People

Contributors

rspurrell avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.