-
Notifications
You must be signed in to change notification settings - Fork 0
/
Basic_Motor_Operation.c
31 lines (26 loc) · 1.34 KB
/
Basic_Motor_Operation.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, S1, HTMotor, HTServo, none, none)
#pragma config(Sensor, S1, , sensorI2CMuxController)
#pragma config(Motor, mtr_S1_C1_1, motorD, tmotorTetrix, openLoop)
#pragma config(Motor, mtr_S1_C1_2, motorE, tmotorTetrix, openLoop, reversed)
#pragma config(Servo, srvo_S1_C2_1, servo1, tServoNone)
#pragma config(Servo, srvo_S1_C2_2, servo2, tServoNone)
#pragma config(Servo, srvo_S1_C2_3, servo3, tServoNone)
#pragma config(Servo, srvo_S1_C2_4, servo4, tServoNone)
#pragma config(Servo, srvo_S1_C2_5, servo5, tServoNone)
#pragma config(Servo, srvo_S1_C2_6, servo6, tServoNone)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
int i;
for(i = 0; i < 1; i++)
{
motor[motorD] = 50; //Motor is at power level 75%.
motor[motorE] = 50; //Motor is at power level 75%.
wait1Msec(5000); //Robot drives for 5000msec.
motor[motorD] = -50; //Motor is at power level 75% in reverse.
motor[motorE] = -50; //Motor is at power level 75% in reverse.
wait1Msec(5000); //Robot drives for 5000msec.
}
motor[motorD] = 0; //Motor is at power level 0.
motor[motorE] = 0; //Motor is at power level 0.
}