Skip to content
This repository has been archived by the owner on Jul 11, 2020. It is now read-only.

Commit

Permalink
before selection
Browse files Browse the repository at this point in the history
  • Loading branch information
theol0403 committed Oct 13, 2018
1 parent 3d5498e commit b0e3549
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 15 deletions.
8 changes: 4 additions & 4 deletions 7842F_Main.c
Expand Up @@ -96,11 +96,13 @@
* \_| |_| \___| \_| |_/\__,_|\__\___/
*/


#include "Auto/AutoLEDTask.c"

void pre_auton()
{
startTask(LCDTask);
startTask(autoLEDTask);


//BNS();

Expand Down Expand Up @@ -162,7 +164,6 @@ task usercontrol()
* \_| |_/\__,_|\__\___/
*/
#include "Auto/AutoSimpleFunctions.c"
#include "Auto/AutoLEDTask.c"

#include "Auto/AutoExec.h"

Expand All @@ -172,8 +173,7 @@ task autonomous()

startTask(FlywheelPIDTask);

startTask(autoLEDTask);


sideColors chosenSide;
chosenSide = (SensorValue[s_sideSelector] > 2047) ? redSide : blueSide;

Expand Down
2 changes: 1 addition & 1 deletion Auto/AutoExec.h
Expand Up @@ -7,7 +7,7 @@

void AutoExec0()
{
#include "AutoExec/AutoExec0.c"
#include "AutoExec/AutoExecSkils.c"
};
void AutoExecRed1()
{
Expand Down
8 changes: 4 additions & 4 deletions Auto/AutoExec/AutoExecBlue1.c
Expand Up @@ -22,9 +22,9 @@ AutoBaseDriveAllign(30, 800);
AutoBaseDriveDistance(-8);


AutoBaseTurnDegrees(-90);
AutoBaseTurnDegrees(-91);

AutoBaseDriveDistance(-10, true, false);
AutoBaseDriveDistance(-11, true, false);

waitUntil(mainFlywheelPID.Error < 30);
wait1Msec(300);
Expand All @@ -34,10 +34,10 @@ AutoIntakeMode(intakeCollect);



AutoBaseDriveDistance(33);
AutoBaseDriveDistance(34);
AutoIntakeMode(indexShoot);
wait1Msec(300);
AutoBaseDriveDistance(5);
AutoBaseDriveDistance(4);
AutoIntakeMode(intakeCollect);


Expand Down
10 changes: 6 additions & 4 deletions Auto/AutoExec/AutoExecRed1.c
@@ -1,4 +1,6 @@



//flywheel bit less than middle rpm - 2500
//-38 inch w/ intake
//38
Expand Down Expand Up @@ -34,15 +36,15 @@ AutoIntakeMode(intakeCollect);



AutoBaseDriveDistance(33);
AutoBaseDriveDistance(34);
AutoIntakeMode(indexShoot);
wait1Msec(300);
AutoBaseDriveDistance(5);
AutoBaseDriveDistance(4);
AutoIntakeMode(intakeCollect);


AutoBaseTurnDegrees(-19);
AutoBaseDriveDistance(9);
AutoBaseTurnDegrees(-20);
AutoBaseDriveDistance(10);
AutoBaseTurnDegrees(19);
AutoBaseDriveAllign(26, 1000);

Expand Down
61 changes: 61 additions & 0 deletions Auto/AutoExec/AutoExecSkils.c
@@ -0,0 +1,61 @@



//flywheel bit less than middle rpm - 2500
//-38 inch w/ intake
//38
//turn -90
//-26
//Shoot

//68
//-23
//turn 90
//outtake
//-24

wantedFlywheelRPM = 2500;

AutoIntakeMode(intakeCollect);
AutoBaseDriveDistance(-38);
wait1Msec(200);
AutoBaseDriveDistance(42);
AutoBaseDriveAllign(30, 800);
AutoBaseDriveDistance(-8);


AutoBaseTurnDegrees(90);

AutoBaseDriveDistance(-10, true, false);

waitUntil(mainFlywheelPID.Error < 30);
wait1Msec(300);
AutoIntakeMode(indexShoot); //sho
wait1Msec(300);
AutoIntakeMode(intakeCollect);



AutoBaseDriveDistance(34);
AutoIntakeMode(indexShoot);
wait1Msec(300);
AutoBaseDriveDistance(4);
AutoIntakeMode(intakeCollect);


wantedFlywheelRPM = 0;
AutoBaseTurnDegrees(-20);
AutoBaseDriveDistance(10);
AutoBaseTurnDegrees(19);
AutoBaseDriveAllign(26, 1000);

AutoBaseDriveDistance(-72);
AutoBaseTurnDegrees(90);
AutoBaseDriveDistance(100);




wantedFlywheelRPM = 0;
AutoIntakeMode(intakeOff);
AutoBaseDriveDistance(0, false, false);
4 changes: 3 additions & 1 deletion Auto/AutoLEDTask.c
Expand Up @@ -36,12 +36,14 @@ task autoLEDTask()



tileColor = (SensorValue[s_tileLine] < 2000);
tileColor = (SensorValue[s_tileLine] < 1900);

selectColor = (SensorValue[s_sideSelector] < 2047);

ledOn = (tileColor != selectColor);

wait1Msec(20);


}
}
2 changes: 1 addition & 1 deletion Shared/LCDTask.c
Expand Up @@ -17,7 +17,7 @@ task LCDTask()
case 0:

displayLCDPos(0,0);
displayNextLCDString(" Slot 0 ");
displayNextLCDString(" Skills ");
displayLCDPos(1,0);

if(SensorValue[s_sideSelector] > 2047)
Expand Down

0 comments on commit b0e3549

Please sign in to comment.