today i got the result of the exam and i got a 95, it is good and i think i can do better in it.
and i am programing for the robots these days and this the code i got today.
when(STARTED){
while(true){
BallLifting.setVelocity(127,percent);
BallLifting.setMaxTorque(127,percent);
Driving1Right.setVelocity((1.27*(Controller1.Axis1.position(percent)+Controller1.Axis2.position(percent))),percent);
Driving2Left.setVelocity((1.27*(Controller1.Axis1.position(percent)-Controller1.Axis2.position(percent))),percent);
Driving1Right.setMaxTorque(127,percent);
Driving2Left.setMaxTorque(127,percent);
CapLifting1Left.setVelocity(90,percent);
CapLifting2Right.setVelocity(90,percent);
CapLifting1Left.setMaxTorque(90,percent);
CapLifting2Right.setMaxTorque(90,percent);
Flywheel1Left.setMaxTorque(127,percent);
Flywheel2Right.setMaxTorque(127,percent);
LShapeStructure.setVelocity(50,percent);
LShapeStructure.setMaxTorque(127,percent);
Driving1Right.spin(forward);
Driving2Left.spin(forward);
BallLifting.rotateTo((Controller1.Axis3.position(percent)*5),degrees);
if(Controller1.ButtonR1.pressing()){
Flywheel1Left.setVelocity(127,percent);
Flywheel2Right.setVelocity(127,percent);
Flywheel1Left.spin(reverse);
Flywheel2Right.spin(forward);
}else{
if(Controller1.ButtonR2.pressing()){
Flywheel1Left.setVelocity(127,percent);
Flywheel2Right.setVelocity(127,percent);
Flywheel1Left.spin(forward);
Flywheel2Right.spin(reverse);
}else{
Flywheel1Left.stop();
Flywheel2Right.stop();
}
}
if(Controller1.ButtonL1.pressing()){
CapLifting1Left.spin(forward);
CapLifting2Right.spin(reverse);
}else{
if(Controller1.ButtonL2.pressing()){
CapLifting1Left.spin(reverse);
CapLifting2Right.spin(forward);
}else{
CapLifting1Left.stop();
CapLifting2Right.stop();
}
}
if(Controller1.ButtonLeft.pressing()){
BallLifting.rotateFor(-840,degrees);
}else{
if(Controller1.ButtonRight.pressing()){
BallLifting.rotateFor(-420,degrees);
}else{
BallLifting.stop();
}
}
}
}
2018年11月13日星期二
订阅:
博文评论 (Atom)
The last Humangeo class
Ok... it is really sad to say goodbye, but the good thing is we can still meet in the School! I have a Robotic competition this Sunday and ...
-
Countries have adopted selective imigrantion policies Preference shown for specific employment placement and family reunification Passing ...
-
Christianity ( Abrahamic in origin ) Christianity is the biggest r eligion of the world which has 2.2 billion believers. The believe...
-
Today, i had my first test on humangeo, hope i can get a good point. Then the other funny thing happened at night. my parents and i wnet to ...
That looks complicated.
回复删除