Skip to content

Instantly share code, notes, and snippets.

View brandon-gong's full-sized avatar

Brandon Gong brandon-gong

View GitHub Profile
#include <LiquidCrystal.h>
LiquidCrystal lcd(9, 8, 5, 4, 3, 2);
double a = 4.800268981e-3;
double b = -4.384001802e-4;
double c = 32.57739182e-7;
double ohmWindow[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
#define RED 12
#define BLUE 10
@brandon-gong
brandon-gong / tapedetector.py
Created February 4, 2019 01:26
detect tape over goal, find resolution of bounding box
import cv2
import numpy as np
import math
DEBUG = True
capture= cv2.VideoCapture(2)
capture.set(10,0)
if DEBUG:
import wpilib
class PIDHelper:
def __init__(self, robot):
self.modules = robot.drivetrain.modules
self.preferences = wpilib.Preferences.getInstance()
def update(self):
p = self.preferences.getFloat("P all")