This repository was archived by the owner on Aug 30, 2025. It is now read-only.
forked from Victinil/Robots
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMy base code
More file actions
77 lines (45 loc) · 2.08 KB
/
My base code
File metadata and controls
77 lines (45 loc) · 2.08 KB
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
/*----------------------------------------------------------------------------*/
/* */
/* Module: main.cpp */
/* Author: niedererfamily */
/* Created: Sat Nov 23 2019 */
/* Description: V5 project */
/* */
/*----------------------------------------------------------------------------*/
// ---- START VEXCODE CONFIGURED DEVICES ----
// Robot Configuration:
// [Name] [Type] [Port(s)]
// IntakeRight motor 19
// IntakeLeft motor 20
// IntakeArmTiltLeft motor 17
// BlockRampTilt motor 5
// IntakeArmTiltRight motor 18
// FrontBump bumper A
// BackBump bumper B
// Drivetrain drivetrain 1, 10
// ---- END VEXCODE CONFIGURED DEVICES ----
#include "vex.h"
using namespace vex;
int main() {
// Initializing Robot Configuration. DO NOT REMOVE!
vexcodeInit();
IntakeArmTiltRight.spinFor(0.05,turns);
IntakeArmTiltLeft.spinFor(-0.05,turns);
bool(blockTouch) = FrontBump.pressing();
if(blockTouch){
Drivetrain.setDriveVelocity(20,percent);
IntakeLeft.spinFor(0.5,turns);
IntakeRight.spinFor(0.5,turns);
Drivetrain.setDriveVelocity(75,percent);
}
/*Drivetrain.driveFor(48,inches);
Drivetrain.turnFor(-90,degrees);
Drivetrain.driveFor(48,inches);
Drivetrain.turnFor(-90,degrees);
Drivetrain.driveFor(48,inches);
Drivetrain.turnFor(-90,degrees);
Drivetrain.driveFor(48,inches);*/
// this is the autonomous strategy TBD
BlockRampTilt.spinToPosition(90,degrees);
Drivetrain.driveFor(-5,inches);
}