From 904c3f1f7cbc4f9038b0dd015f741938917782ca Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Wed, 4 Oct 2023 18:36:26 -0400 Subject: [PATCH] Move title comments below config to work w robotc --- Labs.c | 48 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/Labs.c b/Labs.c index 0192b87..4ed6d37 100644 --- a/Labs.c +++ b/Labs.c @@ -1,12 +1,3 @@ -/* Progressive Development Code - * for ETC 244 VeX Robotics Lab - * Instructor: Bill Dolan - * Fall 2023-2024 - * - * Developed by Skylar Grant -*/ - -// Configuration created by ROBOTC #pragma config(Sensor, in3, armPos, sensorPotentiometer) #pragma config(Sensor, in4, lightRight, sensorReflection) #pragma config(Sensor, in5, lightLeft, sensorReflection) @@ -24,7 +15,19 @@ #pragma config(Motor, port3, clawMotor, tmotorVex393HighSpeed_MC29, openLoop) #pragma config(Motor, port4, armMotor, tmotorVex393_MC29, openLoop) #pragma config(Motor, port10, leftMotor, tmotorVex393_HBridge, openLoop, reversed, driveLeft, encoderPort, dgtl1) -//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// +//^^!!Code automatically generated by 'ROBOTC' configuration wizard!!^^// + +//=====================================================================// + +/* Progressive Development Code + * for ETC 244 VeX Robotics Lab + * Instructor: Bill Dolan + * Fall 2023-2024 + * + * Developed by Skylar Grant +*/ + +//=====================================================================// /* Quick function to set the speed of the drive motors * @@ -41,6 +44,8 @@ void setMotors(int leftSpeed, int rightSpeed) { motor[rightMotor] = rightSpeed; } +//=====================================================================// + /* Quick function to stop both drive motors * * Arguments: None @@ -52,6 +57,8 @@ void stop() { motor[rightMotor] = 0; } +//=====================================================================// + /* Function to drive the bot forward for some time * * Arguments: @@ -69,6 +76,8 @@ void driveForward(int speed, int timeMs) { stop(); } +//=====================================================================// + /* Function to drive the bot backwards for some time * * Arguments: @@ -88,6 +97,7 @@ void driveBackward(int speed, int timeMs) { stop(); } +//=====================================================================// // TODO: Just combine this into one drive function with L/R/B and a reverse boolean /* Function to drive only one side's drive motors for a given time @@ -113,6 +123,8 @@ void driveOneSide(char *side, int speed, int timeMs) { stop(); } +//=====================================================================// + // TODO: Flesh out this function //void drive(char *side, int speed, int timeMs, int reverse) @@ -157,8 +169,10 @@ void turn(char *direction, int speed, int timeMs, bool reverse) { stop(); } +//=====================================================================// + /* Move the bot's arm up or down - * + * * Arguments: * - speed: signed integer. -127 to 127 * - <0: Down @@ -200,6 +214,8 @@ void armUp100(int speed) { motor[armMotor] = 0; } +//=====================================================================// + /* Moves the robot's arm down until the limit switch is pressed * * Arguments: @@ -223,6 +239,8 @@ void armDown100(int speed) { motor[armMotor] = 0; } +//=====================================================================// + /* Close the claw * * Arguments: None @@ -238,6 +256,8 @@ void clawGrab() { motor[clawMotor] = 0; } +//=====================================================================// + /* Open the claw * * Arguments: None @@ -253,6 +273,8 @@ void clawRelease() { motor[clawMotor] = 0; } +//=====================================================================// + /* Run the autonomous code, called when the start button is pressed. * * Arguments: None @@ -289,6 +311,8 @@ void runAutonomous() { armDown100(16); } +//=====================================================================// + /* Wait for the start button to be pressed, then run autonomous code. * * Arguments: None @@ -303,6 +327,8 @@ void waitForStart() { waitForStart(); } +//=====================================================================// + // This function gets called automatically once the bot is booted. task main() { waitForStart();