Code Monkey home page Code Monkey logo

vexide-over-under-example's Introduction

Vexide Template

Build status

Ready-to-use template for developing VEX V5 robots in Rust.

Seasoned Vexide user? Delete README.md and update Cargo.toml as needed.

Table of Contents

Using This Template

To start a project using this template, click the "Use this template" button in the upper right corner of the GitHub repository. Choose an appropriate name and clone the new repository using Git. Finally, update the package name in Cargo.toml:

[package]
name = "my-vex-robot"
version = "0.1.0"
edition = "2021"

Getting Started (Windows)

Install Rust by following the instructions on https://rustup.rs/.

Run the following commands in Powershell to set up your PC for development on Windows.

  • Install Python 3.9:

    winget install -s msstore "Python 3.9"
  • Close and reopen the terminal, and finish installing Vexide:

    pip3.9 install --user pros-cli
    rustup default nightly
    rustup component add rust-src llvm-tools-preview
    cargo install cargo-pros cargo-binutils

Getting Started (macOS)

Run the following terminal commands to set up your Mac for development.

  • Install Homebrew, a package manager for macOS:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    • Under the header "Next Steps", Homebrew may prompt you to run commands to complete the installation.
  • Install Rust and PROS:

    brew install rustup [email protected]
    rustup-init -y --default-toolchain nightly
    pip3.10 install pros-cli
  • Close and reopen the terminal, and finish installing Vexide:

    rustup component add rust-src llvm-tools-preview
    cargo install cargo-pros cargo-binutils

Getting Started (NixOS)

The Nix flake includes a devshell with every tool you need for building and uploading vexide projects. You still need to run rustup component add llvm-tools-preview if you haven't already.

There is a .envrc file for Nix + Direnv users.

Getting Started (Debian/Ubuntu Linux)

Run the following terminal commands to set up your PC for development on Debian or Ubuntu.

  • Install Rust:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  • Install Python 3.9 and PROS:

    sudo add-apt-repository ppa:deadsnakes/ppa
    sudo apt update
    sudo apt install python3.9 python3-pip python3.9-distutils
    
    python3.9 -m pip install --user pros
  • Close and reopen the terminal, and finish installing Vexide:

    rustup default nightly
    rustup component add rust-src llvm-tools-preview
    cargo install cargo-pros cargo-binutils

Getting Started (Fedora Linux)

Run the following terminal commands to set up your PC for development on Fedora.

  • Install Rust and PROS:

    sudo dnf install rustup python3-pip
    rustup-init -y --default-toolchain nightly
    pip install --user pros-cli
  • Close and reopen the terminal, and finish installing Vexide:

    rustup component add rust-src llvm-tools-preview
    cargo install cargo-pros cargo-binutils

Development

Compiling and uploading to a VEX V5 robot

Use the Cargo PROS terminal utility to build and upload this Vexide project.

cargo pros build

Use a USB cable to connect to your robot brain or to your controller before using the upload subcommand to build and upload the project. Make sure to specify a program slot.

cargo pros upload --slot 1

Viewing program output

You can view panic messages and calls to println!() using the PROS terminal. Use a USB cable to connect to your robot brain or controller, then start the terminal:

pros terminal --raw

Using smart editing features

Developers using Visual Studio Code with the rust-analyzer extension have access to smart editing features like Intellisense and code analysis. By default, rust-analyzer will check the project for errors when it is saved.

Troubleshooting

  • If you get the error TypeError: <flag 'BrainFlags'> has no members defined when using the third party pros upload command, you need to downgrade Python to v3.9

vexide-over-under-example's People

Contributors

tropix126 avatar

Watchers

 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.