Skip to content

Instantly share code, notes, and snippets.

@acetousk
acetousk / auton.c
Created January 22, 2019 13:38
PID Help
task leftPIDController()
{
taskRunning=true;
float pidSensorCurrentValue;
float pidError;
float pidLastError;
float pidIntegral;
float pidDerivative;
float pidDrive;
@acetousk
acetousk / hayden.c
Created January 25, 2019 03:39
here hayden this is what you want
int leftVar=vexRT[Ch3]; //check out line 20-22 for how this works
int rightVar=vexRT[Ch2]; //check out line 23-25 for how this works
task usercontrol(){
while(true){
if(vexRT[Btn6U]==1)
motor[intake2]=127;
else if(vexRT[Btn6D]==1)
motor[intake2]=-127;
else
@acetousk
acetousk / autonCodeIfElseTree.c
Created January 25, 2019 14:55
auton code that is a massive if else tree that is a pain to write so this will make it easier probabally...
/*********************************************************************/
/*********************************************************************/
/*********************************************************************/
/** ------------------- 72832S variable definitions -----------------*/
/*********************************************************************/
/*********************************************************************/
/*********************************************************************/
int autonRun;
@acetousk
acetousk / hayden1.c
Created January 25, 2019 20:01
yeee
#pragma config(Sensor, in1, progL1, sensorPotentiometer)
#pragma config(Sensor, in2, progzR1, sensorPotentiometer)
#pragma config(Sensor, dgtl1, , sensorQuadEncoder)
#pragma config(Sensor, dgtl3, , sensorQuadEncoder)
#pragma config(Sensor, dgtl5, , sensorSONAR_inch)
#pragma config(Sensor, dgtl7, , sensorSONAR_inch)
#pragma config(Motor, port1, intake1, tmotorVex393TurboSpeed_HBridge, openLoop)
#pragma config(Motor, port2, driveL1, tmotorVex393HighSpeed_MC29, openLoop)
#pragma config(Motor, port3, drive2, tmotorVex393HighSpeed_MC29, openLoop)
#pragma config(Motor, port4, drive3, tmotorVex393HighSpeed_MC29, openLoop)
@acetousk
acetousk / API.h
Last active January 27, 2019 22:10
72832S Potatehoes Directory
//
// Created by jonesdav004 on 1/23/2019
//
#ifndef POTATOES_API_H
#define POTATOES_API_H
#endif //POTATOES_API_H
/** @file APIh
@acetousk
acetousk / help.cpp
Created April 10, 2019 19:06
controller deadzone verify
int leftJoyVerify(){
static int count;
if(((Controller1.Axis4.value()*Controller1.Axis4.value())/37.5)+37.5<=Controller1.Axis3.value())
count++;
if((-(Controller1.Axis4.value()*Controller1.Axis4.value())/37.5)-37.5<=Controller1.Axis3.value())
count++;
if(((Controller1.Axis3.value()*Controller1.Axis3.value())/37.5)+37.5<=Controller1.Axis4.value())
count++;
if((-(Controller1.Axis3.value()*Controller1.Axis3.value())/37.5)-37.5<=Controller1.Axis4.value())
@acetousk
acetousk / Graph.cpp
Created June 14, 2019 03:12 — forked from theol0403/Graph.cpp
LVGL Builder Example
#include "Graph.hpp"
Graph::Graph(lv_obj_t* parent) : Graph(parent, lv_obj_get_style(parent)->body.main_color) {}
Graph::Graph(lv_obj_t* parent, lv_color_t mainColor) :
graph(lv_chart_create(parent, NULL))
{
lv_obj_set_size(graph, lv_obj_get_width(parent), lv_obj_get_height(parent));
lv_obj_align(graph, NULL, LV_ALIGN_CENTER, 0, 0);
lv_chart_set_type(graph, LV_CHART_TYPE_LINE);
@acetousk
acetousk / KinematicsLogging.cpp
Created April 21, 2020 18:48
PROS Example Code for Logging Kinematics from 2 Encoders and Position from Odom
pros::task_t graphing;
void loop(void* params){
auto lposFilter = std::make_shared<AverageFilter<10>>();
auto lspeedFilter = std::make_shared<AverageFilter<10>>();
auto laccelFilter = std::make_shared<AverageFilter<10>>();
auto ljerkFilter = std::make_shared<AverageFilter<10>>();
auto lsnapFilter = std::make_shared<AverageFilter<10>>();
@acetousk
acetousk / chassis.cpp
Created April 21, 2020 19:00
Example of OkapiLib AsyncLinearMotionProfileController for Forward and Straight Movements
#include "chassis.hpp"
template <typename T> double sgn(T val) {
return (T(0) < val) - (val < T(0));
}
void Chassis::linearProfileStraight(QLength idistance, QLength icurrentPos){
leftProfileController->generatePath ( {icurrentPos.abs(),idistance.abs()}, "straight", straightLimits );
rightProfileController->generatePath( {icurrentPos.abs(),idistance.abs()}, "straight", straightLimits );
bool backward = false;
import org.openqa.selenium.firefox.FirefoxDriver
import org.openqa.selenium.*
import org.openqa.selenium.interactions.Actions
import org.openqa.selenium.support.ui.*
import spock.lang.*
import java.time.Duration
class KatalonGroovyGenerator extends Specification{
@Shared WebDriver driver = new FirefoxDriver()
@Shared Actions actions = new Actions(driver)