Skip to content

Instantly share code, notes, and snippets.

@jpearman
jpearman / flywheel.c
Last active October 17, 2022 07:38
Simple ROBOTC implementation of TBH algorithm
#pragma config(I2C_Usage, I2C1, i2cSensors)
#pragma config(Sensor, I2C_1, , sensorQuadEncoderOnI2CPort, , AutoAssign)
#pragma config(Motor, port2, Motor_FW1, tmotorVex393HighSpeed_MC29, openLoop, encoderPort, I2C_1)
#pragma config(Motor, port3, Motor_FW2, tmotorVex393HighSpeed_MC29, openLoop, reversed)
#pragma config(Motor, port4, Motor_FW3, tmotorVex393HighSpeed_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
/*-----------------------------------------------------------------------------*/
/* */
/* Copyright (c) James Pearman */
@jpearman
jpearman / flywheel_s.c
Last active February 4, 2018 09:06
Simplified version of flywheel control code that does not use a structure to hold all variables
#pragma config(I2C_Usage, I2C1, i2cSensors)
#pragma config(Sensor, I2C_1, , sensorQuadEncoderOnI2CPort, , AutoAssign)
#pragma config(Motor, port2, Motor_FW1, tmotorVex393HighSpeed_MC29, openLoop, encoderPort, I2C_1)
#pragma config(Motor, port3, Motor_FW2, tmotorVex393HighSpeed_MC29, openLoop, reversed)
#pragma config(Motor, port4, Motor_FW3, tmotorVex393HighSpeed_MC29, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
/*-----------------------------------------------------------------------------*/
/* */
/* Copyright (c) James Pearman */
#pragma config(I2C_Usage, I2C1, i2cSensors)
#pragma config(Sensor, I2C_1, ,sensorQuadEncoderOnI2CPort, , AutoAssign )
#pragma config(Motor, port2, motorA, tmotorVex393HighSpeed_MC29, openLoop, encoderPort, I2C_1)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
/*-----------------------------------------------------------------------------*/
/* */
/* Module: velocity_demo.c */
/* Author: James Pearman */
/* Created: 17 Jan 2016 */
#pragma config(I2C_Usage, I2C1, i2cSensors)
#pragma config(Sensor, I2C_1, , sensorQuadEncoderOnI2CPort, , AutoAssign )
#pragma config(Sensor, I2C_2, , sensorQuadEncoderOnI2CPort, , AutoAssign )
#pragma config(Motor, port2, motorL, tmotorVex393_MC29, openLoop, encoderPort, I2C_1)
#pragma config(Motor, port3, motorR, tmotorVex393_MC29, openLoop, reversed, encoderPort, I2C_2)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
/*-----------------------------------------------------------------------------*/
/* */
/* Module: velocity_demo2.c */
#pragma config(UART_Usage, UART2, uartVEXLCD, baudRate19200, IOPins, None, None)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
/*-----------------------------------------------------------------------------*/
/* */
/* Module: menuDemo.c */
/* Author: James Pearman */
/* Created: 25 August 2012 */
/* */
/* Revisions: V0.1 */
/*-----------------------------------------------------------------------------*/
/* */
/* Module: menuDemo.c */
/* Author: James Pearman */
/* Created: 25 August 2012 */
/* */
/* Revisions: V0.1 */
/* */
/*-----------------------------------------------------------------------------*/
/* */