PixyCam 2 Example Code

Is there anywhere where I can find example code for PixyCam 2 for vision targeting for FRC? My team has decided that as a side-project, we wanted to learn how to use PixyCam2 for vision targeting, and example codes would be very useful.

here is how we did it

we copied the API from the link below strait into our project:

import io.github.pseudoresonance.pixy2api.*;
import io.github.pseudoresonance.pixy2api.Pixy2CCC.Block;
import io.github.pseudoresonance.pixy2api.links.*;

class classname extends SubsystemBase {
  private final Pixy2 pixy;

  public PixySystem() {      
      this(new SPILink());

  public PixySystem(Link link) {
      pixy = Pixy2.createInstance(link);
1 Like