Giter Site home page Giter Site logo

theboredprogrammer64 / spark-max-examples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from revrobotics/spark-max-examples

0.0 0.0 0.0 1.97 MB

Example code for SPARK MAX

License: BSD 3-Clause "New" or "Revised" License

C++ 7.33% Java 9.31% LabVIEW 83.36%

spark-max-examples's Introduction

SPARK-MAX-Examples

Table of Contents

Installing libraries for Java/C++

Download the SPARK-MAX-roboRIO-SDK from RevRobotics.

Extract the zipped archive to a location where you can find it. Within the extracted folder, there will be two folders title "maven" and "vendordeps".

alt text

Copy and paste these folders into the location C:\Users\Public\wpilib\2020. Replace the files in the destination if you are prompted.

alt text

Installing in Visual Studio

Once the archive containing the SPARK-MAX-roboRIO-SDK has been extracted to the correct location, it can be installed in Visual Studio.

Begin by creating a new project in the language of your choice or by opening an existing project. Press ctrl + shift + p to bring up the command pallette and select WPILib: Manage Vendor Libraries

alt text

Then select Install new libraries (offline), check the box next to RevRobotics and select OK.

alt text

After a few moments SPARK MAX libraries will be available for you to use in your current project. This process will need to be repeated for each subsequent project that requires SPARK MAX libraries.

For Java all functions can be imported using import com.revrobotics.*;. Similarly, for C++ use #include "rev/CANSparkMax.h.

Building and Running Examples in Visual Studio

After cloning this GitHub repository, Java and C++ examples can be opened in Visual Studio by going to File->Open Folder... and selecting the parent folder of the example you want to run.

By default, the Team Number is set to 0 in the .wpilib/wpilib_preferences.json file. Make sure to change this to the Team Number configured on your roboRIO by either editing this file directly or by pressing ctrl + shift + p and selecting WPILib: Set Team Number.

Installing libraries for LabVIEW

Download the SPARK MAX LabVIEW API from RevRobotics here.

Simply run the installer and follow the instructions on screen.

Running Examples in LabVIEW

Open LabVIEW and select File->Open Project.... Open the .lvproj file in the top directory of the example you wish to run.

By default the IP address of the roboRIO is set to 172.22.11.2. This IP address will work if you are connecting to the roboRIO over USB, but if you are connected over ethernet or WIFI you will need to right click Target, select Properties, and configure the IP set for your roboRIO.

alt text

Run the program by opening Robot Main.vi a pressing the white arrow at the top of the window.

alt text

spark-max-examples's People

Contributors

auscompgeek avatar kellyostrom avatar ryanj1234 avatar sciencewhiz avatar trevnerd avatar willtoth avatar wolfgang42 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.