This repository has been archived by the owner on Jun 12, 2019. It is now read-only.
forked from aerhoespace/Pink_Highlights
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
100 lines (76 loc) · 3.7 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*----------------------------------------------------------------------------*/
/* */
/* Module: main.cpp */
/* Author: meredithgreen */
/* Created: Sun Apr 07 2019 */
/* Description: V5 project */
/* */
/*----------------------------------------------------------------------------*/
#include "vex.h"
using namespace vex;
// A global instance of vex::competition
vex::competition Competition;
/*---------------------------------------------------------------------------*/
/* */
/* Pre-Autonomous Functions */
/* */
/*---------------------------------------------------------------------------*/
void pre_auton( void ) {
//start the ritual
littleCeasars();
//wait for VEX to not be a dumb :P
LF.setStopping(vex::brakeType::coast);
LB.setStopping(vex::brakeType::coast);
RF.setStopping(vex::brakeType::coast);
RB.setStopping(vex::brakeType::coast);
lift.setStopping(vex::brakeType::hold);
puncherLeft.setStopping(vex::brakeType::brake);
puncherRight.setStopping(vex::brakeType::brake);
intake.setStopping(vex::brakeType::coast);
vex::task Sel (selFun);
}
/*---------------------------------------------------------------------------*/
/* */
/* Autonomous Task */
/* */
/*---------------------------------------------------------------------------*/
void autonomous( void ) {
vex::task Ramping (Drive_Ramping); //starts ramping to run in the background
//vex::task AutoInt (Auto_Intaking); //starts auto intake task
AtonPots();
}
/*---------------------------------------------------------------------------*/
/* */
/* User Control Task */
/* */
/*---------------------------------------------------------------------------*/
void usercontrol( void ) {
// User control code here, inside the loop
while (1) {
// This is the main execution loop for the user control program.
// Each time through the loop your program should update motor + servo
// values based on feedback from the joysticks.
Brain.Screen.clearScreen();
DriveRampingEnabled=false; //turn off ramping for driver control
//vex::task AutoInt (Auto_Intaking);
DriveCont();
LiftCont();
PuncherCont();
IntakeCont();
vex::task::sleep(20); //Sleep the task for a short amount of time to prevent wasted resources.
}
}
//
// Main will set up the competition functions and callbacks.
//
int main() {
//Set up callbacks for autonomous and driver control periods.
//Run the pre-autonomous function.
pre_auton();
Competition.autonomous( autonomous );
Competition.drivercontrol( usercontrol );
//Prevent main from exiting with an infinite loop.
while(1) {
vex::task::sleep(100);//Sleep the task for a short amount of time to prevent wasted resources.
}
}