Here is our final robot from today. You can see my servo attachment on top. |
The servo operated a channel with a object enclosed. The final program was simple and had the object get dumped off the robot. I have included the code from the dumping program below:
#pragma config(Hubs, S1, HTMotor, HTServo, none, none)
#pragma config(Motor, mtr_S1_C1_1, Wheel_Left, tmotorNormal, openLoop, reversed)
#pragma config(Motor, mtr_S1_C1_2, Wheel_Right, tmotorNormal, openLoop)
#pragma config(Servo, srvo_S1_C2_1, Experimental, tServoStandard)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main()
{
int Universal_Speed = 25;
servo[Experimental] = 0;
motor[Wheel_Left] = Universal_Speed;
motor[Wheel_Right] = Universal_Speed;
wait1Msec(2000);
motor[Wheel_Left] = 0;
motor[Wheel_Right] = 0;
servo[Experimental] = 90;
wait1Msec(2000);
servo[Experimental] = 0;
wait1Msec(2000);
}
No comments:
Post a Comment