Created
February 9, 2023 13:18
-
-
Save 1oonie/e1e9920b517c08c473055c6a3afc9174 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma config(Motor, port3, br, tmotorVex393_MC29, openLoop) | |
#pragma config(Motor, port4, fl, tmotorVex393_MC29, openLoop) | |
#pragma config(Motor, port5, belt, tmotorVex393_MC29, openLoop) | |
#pragma config(Motor, port8, bl, tmotorVex393_MC29, openLoop) | |
#pragma config(Motor, port9, fr, tmotorVex393_MC29, openLoop) | |
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*// | |
#define activation_energy 40 | |
void left_(int a) { | |
motor[fl] = a; | |
motor[bl] = a; | |
} | |
void right_(int a) { | |
motor[fr] = a; | |
motor[br] = a; | |
} | |
task main() | |
{ | |
bool belting = false; | |
while (true) { | |
if (abs(vexRT[Ch3]) >= 40) { | |
left_(vexRT[Ch3]); | |
} | |
if (abs(vexRT[Ch2]) >= 40) { | |
right_(vexRT[Ch2]); | |
} | |
if (vexRT[Btn5U]) { | |
belting = !(belting); | |
} | |
if (belting) { | |
motor[belt] = 127; | |
} else { | |
motor[belt] = 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment