-
Notifications
You must be signed in to change notification settings - Fork 0
/
ArmTest10.17.12.c
executable file
·31 lines (25 loc) · 1.08 KB
/
ArmTest10.17.12.c
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
#pragma config(Hubs, S4, HTMotor, HTMotor, HTMotor, HTServo)
#pragma config(Sensor, S4, , sensorI2CMuxController)
#pragma config(Motor, mtr_S4_C1_1, motorD, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S4_C1_2, motorE, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S4_C2_1, motorF, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S4_C2_2, motorG, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S4_C3_1, shoulder, tmotorNormal, openLoop)
#pragma config(Motor, mtr_S4_C3_2, elbow, tmotorNormal, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#include "JoystickDriver.c"
task main
{
while (true)
{
getJoystickSettings(joystick);
int elbowPower = 0;
int shoulderPower = 0;
if (abs(joystick.joy1_y2)>20)
elbowPower = joystick.joy1_y2 / 4;
if (abs(joystick.joy1_y1)>20)
shoulderPower = joystick.joy1_y1 / 4;
motor[elbow] = elbowPower;
motor[shoulder] = shoulderPower;
}
}