Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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;